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

executing VB macro in script

Hello all,

I have craeted the macro

Sub SMS

set obj=ActiveDocument.GetSheetObject("CH1736")

obj.ExportEx "E:\ADW_Trigger\QlikviewSMS.txt",1

End Sub

Can anyone tell me how do i execute this in script?? So that desire output i.e a text file will be created in ADW_Trigger folder as mention in macro??

15 Replies
Not applicable
Author

  I have scheduled application on publisher but  post reload on macro ain't working , file is not getting created in folder,couldnot figure out why macro is not getting executed? is this because i scheduled it on publisher ?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Add this two commands at the end of the macro

ActiveDocument.Save  

ActiveDocument.GetApplication.Quit

Hope this helps.

Regards,

jagan.

Anonymous
Not applicable
Author

In the publisher you can create Supporting task and add trigger for the task after the app reloading/distribution.

ext.task.png

In the command line statement you need to put your macro script execution via batch file(just transfer function from module to vbs file)

batch file example:

cscript "C:\SMS.vbs"

VBS:

Sub SMS

set obj=ActiveDocument.GetSheetObject("CH1736")

obj.ExportEx "E:\ADW_Trigger\QlikviewSMS.txt",1

End Sub

Not applicable
Author

Hi,

I added both

ActiveDocument.Save 

ActiveDocument.GetApplication.Quit

at the end of macro and ran it through publisher but file is not getting created in folder, if i dont run it through publisher it works ,couldnot find out the reason??

Not applicable
Author

Hi,

I added both

ActiveDocument.Save

ActiveDocument.GetApplication.Quit

at the end of macro and ran it through publisher but file is not getting created in folder, if i dont run it through publisher it works ,couldnot find out the reason??

jagan
Luminary Alumni
Luminary Alumni

Hi Rohit,

Try using the Windows scheduler instead of Qlikview publisher.

Regards,

Jagan.