Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

bat file to call QV and start a Macro

Dear All,

I need to start a macro once a day in an specific time, so I create this Macro in the QV with an IF statement to check the time and I´m trying to use a bat file to open the QVW in the server, execute the macro and close the project.

The problems are:

     1) If I run the bat file from the server desktop it works fine. When I use Windows Server schedule it executes the QVW but don´t run the macro.

      2) I´m using the /R parameter but I don´t need to load the data. I need to open the QVW execute the macro and close the QVW. Exists any parameter or a command to be inserted in the macro to close the Desktop QV withou saving?

Thanks in advance,

André Rodrigues

3 Replies
Anonymous
Not applicable
Author

Hi Andre,

For question 1, try placing the macro code in a vbs script file and schedule this (or call it from the bat file).

set Qv = CreateObject("QlikTech.QlikView")

Qv.OpenDoc "C:\Folder\Filename.qvw"

set QvDoc = Qv.ActiveDocument

INSERT MACRO HERE and start every call with "QvDoc."

Qv.Quit

Question 2: The /R parameter is optional. /R will reload the script, save the document and close QlikView. If you don't add a parameter there it will just load the document. See section 7.1 in the QlikView reference manual.

Not applicable
Author

Andre

Did you find a solution for your problem #1?

I have a batch script which reloads QVW file and triggers macro in it. It is working file when i run manually but when i schedule batch through my scheduler its not working.

Thanks

marcus_sommer

Some activities requires run with priority and not as background process.

http://community.qlik.com/message/310813#310813

http://community.qlik.com/message/296673#296673

- Marcus