Has anyone successfully scheduled a deski report in XIR2 with a macro? if so, what is the syntax for the macro?
rb44169 (BOB member since 2006-01-27)
Has anyone successfully scheduled a deski report in XIR2 with a macro? if so, what is the syntax for the macro?
rb44169 (BOB member since 2006-01-27)
Once you’ve created the macro, you need to call it from the After_Refresh event in order to get it to run in the XI Scheduler.
MichaelWelter (BOB member since 2002-08-08)
I got the macro to work after I refresh the document using 2 tier deski. The same macro won’t execute when I schedule it.
rb44169 (BOB member since 2006-01-27)
Post the code … maybe we can point out the issue.
Dwayne Hoffpauir (BOB member since 2002-09-19)
This is a known issue.
See Execute macro in scheduled Deski document??? especially the reply by Stephane Rodriquez.
A recommended approach is to use VB program objects that get invoked.
See Pop up box for macros running in Infoview
Irwin Miller (BOB member since 2002-08-16)
Hi All,
Is this issue has been resolved? we have issue executing macro in XIr2 scheduler.
Thanks
Saikutty (BOB member since 2005-07-28)
Change the ActiveDocument reference to ThisDocument. This is one of the known (and VERY poorly documented) changes that are needed.
I think it has something to do with the fact that multiple documents open simultaneously is not supported. If there can only be one, then ActiveDocument has no relevance. Lack of multi-document support could also explain why add-ins cannot be used. All speculation, of course.
Give ThisDocument a try and cross your fingers for luck!
Dwayne Hoffpauir (BOB member since 2002-09-19)
Dwayne,
I tried with ThisDocument but got the Run Time Error 438: "Object does’t support this property or method.
any suggessions would be appreciated.
Thanks
Saikutty (BOB member since 2005-07-28)
Hmmm … did you use JUST ThisDocument, or Application.ThisDocument? Lose the Application. part and see if that helps.
Dwayne Hoffpauir (BOB member since 2002-09-19)
Dwayne,
Thanks for your suggession.
Previously I used Application.ThisDocument and I got that error. After your suggession I tried with “ThisDocument” only keeping “Application” part apart and It ran successfully and created pdf but its incomplete.
It only generated one pdf without any variable name at the end of the pdf file
It generated pdf’s correctly in DeskI but when scheduled
see below
it generated this “19982abcdB.pdf” instead of these
“19982abcdB0001.pdf”
“19982abcdB0003.pdf”
where 0001 is the variable in the report.
Do I need to modify the code ?
Any suggessions would be appreciated.
Thanks
Saikutty (BOB member since 2005-07-28)
I don’t have time to go through all of the code, but several of your variables are prefixed with str, which I assume is to indicate String, yet the variables themselves are declared as objects (DocumentVariable, Variable, etc.).
Dwayne Hoffpauir (BOB member since 2002-09-19)
Its sounds like its creating pdf for last value of the variable, its not creating pdf’s for all variable filter values.
I dont have much vba experience, anybody suggest why its happening when scheduled. In Deski it generating pdf’s for all variable values.
Thanks
Saikutty (BOB member since 2005-07-28)