Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Auto Export to Excel File (upon reload) using qv macro

Hi,

I manage to find a lot of different scripts on line to export to csv or excel format and here's what I have now:

Sub ExportFile

ActiveDocument.Sheets("SH01").Activate

set obj1 = ActiveDocument.GetSheetObject("CH01")

obj1.ExportBiff "C:\paht\" & "FileName" &Right("0" & Day(Now)-1,2)&Right("0" & Month(Now),2)&Year(Now())&".xls"

ActiveDocument.GetApplication.Sleep 5000

End Sub

Still, everytime I reload the qlikview, this export script doesn't seem to run and there's no excel file being saved. Only when I go to Tools >> Edit Module and test/run the macro that the excel file is being exported and saved in the specified location. Is there anything I can do so that when I reload the macro will run also?

Appreciate the help!

Regards,
Joy

1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

I ran a sample test and it is working. Pleasee  take a look at the attached file. Take a look also at the below:

Go To DocumentProperties

Click the tab "Triggers"

Under "Document Event Setting"  select "OnPostReload"

Click on "Edit Action(s) button and you will see the actions

Hope this helps...

Note: Please make sure, that in the macro you update the correct file path. I am using Temp\Tuesday as my path.

View solution in original post

5 Replies
trdandamudi
Master II
Master II

I ran a sample test and it is working. Pleasee  take a look at the attached file. Take a look also at the below:

Go To DocumentProperties

Click the tab "Triggers"

Under "Document Event Setting"  select "OnPostReload"

Click on "Edit Action(s) button and you will see the actions

Hope this helps...

Note: Please make sure, that in the macro you update the correct file path. I am using Temp\Tuesday as my path.

beck_bakytbek
Master
Master

Hi Joy,

i am sure, this topic will resolve your issue or you can finde better solution for your business-situation

http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/

beck

Not applicable
Author

Thank you!!

trdandamudi
Master II
Master II

Awesome... Glad able to help out....

DavidD
Contributor
Contributor

It's important to note that the solution works indeed when reloading locally but does not work when reloading through a task on the management console unfortunately...At least it didnt work for me. If someone has a way, besides NPrinting, I'd be glad to see it!