Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to execute a .vbs file which is running an embedded macro in Excel.
It works from my local pc but when it is deployed to QMC, gets completed successfully but doesn't execute the macro.
All security checks are enabled in settings.ini and .qvw so, don't know what's the problem.
My .qvw script:
EXECUTE cscript.exe "..\..\Folder_1\Folder_2\Script.vbs";
Script.vbs:
Option Explicit
Dim xlApp, xlBook, scriptdir
scriptdir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)
Set xlApp = CreateObject("excel.application")
Set xlBook = xlApp.Workbooks.Open(scriptdir & "\Macro_file.xlsm",0, False)
xlApp.Run "RefreshAll"
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing
Thanks in advance.
This error could mean that there is no Excel installed, Excel isn't licenced, Excel settings didn't allow the use of ActiveX or ActiveX is globally denied (it's a very powerful feature and therefore relevant for security and often restricted) or something similar.
Just start Excel on the server directly and if everything worked you may execute some simple Excel macro with an ActiveX statement like CreateObject.
- Marcus
recheck both of these parameters
Security Tab in User preferences in QVW (STRG+ALT+U)
AllowExecuteCommand=1 in Settings.ini
Path: C:\Windows\System32\config\systemprofile\AppData\Roaming\QlikTech\QlikViewBatch
Under [Settings 7] add following line
AllowExecuteCommand=1
after this you need to restart the qlik Services
This is already correctly set up.
The point is that the task gets completed successfully but it is not triggering the macro.
alright.
did you test that locally with the user that is assigned to the qlik Service?
see here
how to allow execute on server
Regards
Hi,
I already checked but it is not working.
Same happens with .bat files, which do work when I execute them manually but not from the QMC.
I've tried almost everything and don't know what's the problem.
Thanks both!
There are a lot of possibilities which may cause the failure. To exclude most of them unless the QMC related ones login to the server with the QV services-user and run there the reload with the desktop client. The usual missing access rights, invalid paths, missing Excel configurations/licences and similar should be popup more or less obvious.
- Marcus
HI Zhdrakas/Marcus,
I've tried login with the QV services-user and run in the server the .qvw with the desktop client.
I've attached the error (ActiveX component can't create object 'excel,application')
The .qvw code which contains the execute statement is completed successfully when I execute it with my user either in local or the server.
Regards,
This error could mean that there is no Excel installed, Excel isn't licenced, Excel settings didn't allow the use of ActiveX or ActiveX is globally denied (it's a very powerful feature and therefore relevant for security and often restricted) or something similar.
Just start Excel on the server directly and if everything worked you may execute some simple Excel macro with an ActiveX statement like CreateObject.
- Marcus
Indeed! Excel was not installed in the server.
I will talk to the team and try after installing the software. Will let you know.
Thanks for your support!