Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Batch File and Reloading the QVW with Post Reload macro

Dear Friends,

In my Qv application ,i am using macro for converting the reports in PDF and i triggered the macro to run after Post reload of the application automatically. When i reload the QV application manually which contains the macro for PDF conversion it's working fine and all the PDF reports are getting stored in the mentioned path but when i run the same QV application using the batch file ,the application is reloading without any issues but the batch file is quitting immediately after the appliation gets reloaded so that the macro process for PDF conversion is not completing so that the PDF reports are not generated and stored in the mentioned path...Is there any command or syntax to make the batch file to wail until the macro for PDF gets over ? Can anybody help me to sort out this problem...?

Regards

Muruganantham S

Qlikview Developer

16 Replies
biester
Specialist
Specialist

James,

in reply to your latest post:

I attached a simple James.qvw with a button (action is a macro which does a reload).

With this external VBS Script

Set MyApp = CreateObject("QlikTech.QlikView")
Set MyDoc = MyApp.OpenDoc ("c:\James.qvw","","")
Set Button = MyDoc.GetSheetObject("BU01")
Ret = Button.Press
MyDoc.Save
Set MyDoc = Nothing
MyApp.Quit
Set MyApp = Nothing

the James.qvw should be reloaded and saved.

Rgds,
Joachim

james
Creator III
Creator III

Joachim,

Ret = Button.Press

This isnt triggering the button to be pressed, am I missing somehting?

biester
Specialist
Specialist

This IS triggering the button to be pressed (at least it is here with me). Obviously in this context Press is more a property than a method (or at least has to be treated as a property) so you have to assign it to a value. So, "Ret" is the result which the Button.Press returns.

Have you tried it?

Rgds,
Joachim

james
Creator III
Creator III

Yes, I have this in a vbs cript called "Daily.vbs"

If i click on the vbs to run, it diesnt press the button (the button triggers a macro that exports an excel file to a loactaion on the server)

Very odd.... I cant think this is that difficult 🙂

Set MyApp = CreateObject("QlikTech.QlikView")
Set MyDoc = MyApp.OpenDoc ("James.qvw","","")
Set Button = MyDoc.GetSheetObject("BU01")
MyDoc.Reload
Ret = Button.Press
MyDoc.Save
Set MyDoc = Nothing
MyApp.Quit
Set MyApp = Nothing

biester
Specialist
Specialist

If your VBScript runs without error but just the macro is not executed, then I'd say it can only be a security issue of the module (have you checked "Requested Module Security" and "Current Local Security"?) or the "Security" settings of the "Document Properties" or the user executing the script has no right to write to the server location. Try to set security to the "most unsecure level" and try script again. If it does not execute then, I ain't got no idea any more...It works just fine here with me.

Rgds,
Joachim

danielrozental
Master II
Master II

This is totally a bug.

Check out QV9 SR3 release notes

24192Macro Trigger OnPostReload doesn't work if you have more than one document opened

james
Creator III
Creator III

Has anyone ever seen and figured out why the VBS Script will run fine, than intermittently error out stating Object Required? Even though the object is there and it ran fine 10 minutes ago; The only fix I have is when I restart my PC it runs