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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
fredericvillemi
Specialist
Specialist

Make the server launch an EXE through a Macro with AJAX

Hi,

is it possible to run an executable on the server through a Macro in AJAX ? (server 11R2)

I have a Macro linked to a button :

Sub export()

      Set shell = CreateObject("WScript.Shell")

                                   shell.Run "d:\launch.cmd "

End Sub

It works great on Desktop but does nothing when used through AJAX

is it normal ?  how can i do ?

I have set the server to Allow unsafe macros

5 Replies
jerrysvensson
Partner - Specialist II
Partner - Specialist II

Every in Ajax runs serverside.

"d:\launch.cmd" points to QlikView Server and executes there.

fredericvillemi
Specialist
Specialist
Author

Yes, i would love that it would launch on the server

d:\launch.cmd is on the server

but it doesn't work, nothing is launched

Not applicable

Hi,

When using web client all macros are executed in the client. So D:\launch.cmd is being searched on the client machine by AJAX rather then server machine.

You probably need to provide UNC name of your cmd file so that it can be found on server.

Hope this help.

Regards,

Anosh

jerrysvensson
Partner - Specialist II
Partner - Specialist II

No it is run at server when using Ajax.
Frederic:
Are you running Internet Explorer?
Have you set Macro security to :
System Access
Allow System Access
Try setting a variable value after the line:
Set shell = CreateObject("WScript.Shell")
Set vTest = ActiveDocument.GetVariable("vVar")
vTest.SetContent "testing",true
This to make sure CreateObject doesn't fail.
julian_rodriguez
Partner - Specialist
Partner - Specialist

Also you may try enabling the Allow macro execution on server and Allow unsafe macro execution on server on your Qlikview Server Managment Console.

Go to System->Setup->Qlikview Servers->Security tab.

Regards