Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

'Execute' statement in QVW file under QMC

Hi,

Have you ever tried to run on QMC qvw file which contains Execute statement?

What I would like to do is to execute some vbs script in qvw's loop, however it doesn't work on QMC.

It works appropriately when I open and reload the document.

But on the QMC it still fails.

Log: “Error: The source document was not reloaded successfully. DocumentPath = ”

Thanks in advance for any advice or suggestion.

7 Replies
swuehl
MVP
MVP

Which version are you using? There have been some changes to authorization of Execute statement in recent versions:

Authorizing the Script EXECUTE Statement | Qlikview Cookbook

Are you sure the scripts run fine under the user that is used to reload your documents on the server?

Have you also looked into the document log, if there is any hint why the script failed?

Not applicable
Author

Hi Swuehl

Thank you for your reply.

  • QV Version QV11 SR12 (11.20.12904.0)
  • Yes I am sure that script works fine under the user.
  • I have checked document logs and didn't find any hints... Script just stopped on Execute statement...
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Can you confirm the "AllowExecuteCommand" setting?

-Rob

Not applicable
Author

Hi,

As I have checked  - AllowExecuteCommand = 1. So, it seems that it is set correctly...

Do you have any other idea?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Is it possible that the vbs script being run by the EXECUTE can not run successfully under the account running the QV Server? Can you logon to a desktop using the server account and try to run the script?

-Rob

Not applicable
Author

Hi

It seems that there is no the problem with EXECUTE statement. VBS is executed and stops on some part of script related to excel, like:

objExcel.Workbooks.OpenText...

objExcel.ActiveWorkbook.SaveAs...

However some other part of the script related to excel works correctly. For example:

objExcel.Workbooks.Add

objExcel.ActiveWorkbook.Close

When I reload this vbs 'manually' directly from qvw it works correctly...

Does it possible that the console user has incorrectly permission set for Excel application?

Thanks Rob for your suggestion. I am not able to log as a console user. I will ask admin.

marcus_sommer

I have had also various problems by the run from batches and programs triggered through EXECUTE staments from the qmc (not only yet in QV 11 SR12 also earlier with QV 10) and I haven't implemented any real solutions - I simply use workarounds (because they worked before I knew - very probably not all but surely some important one - what is the cause for the problems).

Reason one is that the qvb.exe runs as a background-service and if it triggered external tasks they will run also as a kind of a background-service without a gui and it seems that some features need a gui. Probably not directly the gui - it's more that then some system-dll's aren't available and/or that security settings like the settings from the modul-security will be ignored and/or that there are certain dependencies between anything which aren't covered.

An example of this is already the difference between the command-batch parameter of /r and /l:

REM /r = open+reload+save+close as background process  /l = open+reload+save with GUI

"D:\QlikView_Client\QV.exe" /l "D:\YOURFILE.qvw"

For example with using /r as parameter I couldn't send mails per cdo.message (no error-messages) whereby if I use /l it worked smoothly (i need only to close these instance after finishing per: ActiveDocument.GetApplication.Quit

Another reason are user-settings/configurations from the user who runs the qvb.exe respectively if you run your qlikview server without a user-login because then the windows default-user will be used.

Like above mentioned I didn't solved it. So my workarounds are to run the tasks with a gui and beeing always logged in (not with the user from the server-account (had no access to our network storage) else with my normal user-account - and yes I do also some runas-stuff but not everything worked in each case). Further helpful is it not to start the batches directly from Execute-statement else to start a windows-task which then started the real tasks, see for this: Re: Run Excel macro via QMC.

- Marcus