DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Report Sheet Copy

Solved!
Go to solution

Hi guys,

I've got a problem with Diadem 2014. I'm running a windows scheduled task which starts Diadem with a given script. That works fine (for years now). But lately I changed the report generation to be more flexible, ie creating/copying sheets from within the script.

 

The problem now occurs after using

Set shUser = Report.Sheets.Copy("sheet1", "user_sheet", 1)

, the new sheet is created, but it is empty. I've tried some solutions discussed in this topic Report Copy - Objects Missing

but none of them are working when running the script via Microsoft Windows Task Scheduling (Diadem not visible). Running the script myself with visible Diadem window works just fine. Hence, I guess the culprit here is the non-visible Diadem window?

 

I also tried

GraphSheetCopy "sheet1", "user_sheet", Report.Sheets.Count + 1
Set shUser = Report.Sheets("user_sheet")

And also

Report.Sheets("sheet1").Activate

Set shUser = Report.Sheets.Copy("sheet1", "user_sheet", 1)

Does anyone have a solution for that problem? besides upgrading to a newer Diadem Version, as this is not possible due to clients restrictions.

Help is greatly appreciated.

 

Thanks for the help,

Mateusz

0 Kudos
Message 1 of 7
(3,037 Views)
Solution
Accepted by NoName123

Hi Mateusz,

If you run this function without a visible DIAdem you Need at least Version 2017. DIAdem 2014 Supports this only with user Interface.

Greetings

Walter

Message 2 of 7
(2,965 Views)

Hi Walter,

thanks for the reply. I was afraid this would be the case. So I have to resort to manual copies of this sheet and delete the ones I don't need when running the script.

 

Best regards,

Mateusz

0 Kudos
Message 3 of 7
(2,949 Views)

okay, I have to piggy-back on this thread another question as it came up right now.

 

After I changed the script and the report as described above, another error occurs. This time, when running

 

Report.RefreshSilent

the following message is logged:

109  14:36:33 Fehler:
     Fehler in <class_AuswertungTag.VBS> (Zeile: 630, Spalte: 9):
     List index out of bounds (-1)

 When running the code manually with Diadem visible it works, so I assume the problem stays the same, ie the hidden Diadem? Just want to check.

 

Workaround 2: Create several copies of the Report with different numbers of pages and load the one with as many sheets as needed.

 

Mateusz

0 Kudos
Message 4 of 7
(2,943 Views)

Hi Mateusz,

is it possible to get a small script which reproduces this problem?

Greetings

Walter

0 Kudos
Message 5 of 7
(2,928 Views)

Hi Walter,

sorry for the delay, I'm a little swamped right now.

 

It turned out, that RefreshSilent was the culprit and doesn't work without visible GUI either. So thank you for your help, the Script is now up and running. After 6th of September I'll have a litle more time on my hand and could make a minimal script reproducing the problem, if you're still interested in solving the underlying problems.

 

So long and thanks for alle the help 🙂

Best regards,

Mateusz

0 Kudos
Message 6 of 7
(2,782 Views)

Hi Mateusz,

Yes, please send me the script. Then I can check it with the latest DIAdem version.

Greetings

Walter

0 Kudos
Message 7 of 7
(2,774 Views)