Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Run macro from server

Is there any way to have the Enterprise Manager run a macro when reloading a QV-document? I've tried setting up running of this macro with Task Scheduler on Windows Server 2008 but I can't get it to run properly without myself being logged in. Also it requires my account to be associated with a developer-license which is also undesirable. I'd like it to just run from the server. Is this possible?

23 Replies
Not applicable
Author

hi,

Wat u can do is write the macro in notepad n save it as .vbs file(vbscript). Then u can write a batch file to run this file.

Now at qmec u can include this batch file in external tasks.

Hope this helps.

Br,

Prasanna.

Not applicable
Author

Thanks for the reply.

My macro interacts with some of the components in the QV-document (performing various selections and such things). Will this work when run as external task? Will the API for QlikView still be available for VBScript-code that runs "outside" of the QV-document?

Not applicable
Author

hi,

what you need to do is to open the qlikview application in the macro in the vbscript. I think it shd work...but I'm not sure of it...

If it is ok 4 u to specify the req. it'll be helpful for me. But thats up to u to decide.

Br,

Prasanna.

Not applicable
Author

I did some alterations to my macro and I can now run it from a .vbs-file outside of QV. Thanks for the suggestion!

Now for my next question (and it might be a silly one), where in QMEC do configure external tasks? I can't find it anywhere.

lhr
Employee
Employee

i believe it's system -> supporting tasks

Not applicable
Author

I find no "Supporting tasks"-option or tab under System. I'm using QlikView Server 10 btw.

lhr
Employee
Employee

im sorry, i should have mentioned that the supporting tasks tab requires a publisher license.

Not applicable
Author

Ah, we don't have one of those yet

Not applicable
Author

I have exactly the same problem and have "Supporting Tasks" availaible. But how to write a VBScript to open a specific QlikView App, exporting data to an excel file and close the app?

At this moment i have a macro inside the app, but it works only when manually starting the macro "export":

sub export

    call exportToExcel("tb1", "c:\excelfile_")

end sub

sub exportToExcel(objectId, filePath)

    strText=FormatDateTime(Now(),2)

    dim o

    Set o = ActiveDocument.GetSheetObject(objectId)

    o.ExportBiff filePath & mid(strText,7,4) & mid(strText,4,2) & mid(strText,1,2) & ".xls"   

    Set o = nothing

end sub

Thanks for your help!