Qlik Community

QlikView Publisher

Discussion Board for collaboration on QlikView Publisher.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Run macro from server

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

Run macro from server

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

Run macro from server

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

Run macro from server

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
Contributor III

Run macro from server

i believe it's system -> supporting tasks

Not applicable

Run macro from server

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

lhr
Contributor III

Run macro from server

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

Not applicable

Run macro from server

Ah, we don't have one of those yet

Not applicable

Run macro from server

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!

Community Browser