Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i found a few posts on the export functions but still couldn't get it to work from the load script...
i have a QV table that i want to export to Excel and send to email every morning using scheduler.
i created a function that save to Excel and another one that send the email.
both functions work when i call them from macro BUT when i add them to the loading script the save to Excel function doesn't work.
this is the save to Excel function (working from macro but not from the load script, i also tried the copy paste method but same result its working from the macro but not from the load script)
Function CopyToExcel ()
set XLApp = CreateObject("Excel.Application")
'XLApp.Visible = True
ActiveDocument.Sheets("SH01").Activate
set obj = ActiveDocument.getSheetObject("TB01")
XLApp.DisplayAlerts = False
obj.ExportBiff "C:\test.xls"
XLApp.Quit
End Function
this is the line i use at the end of my loading script to call the function:
LET vExecFunction = CopyToExcel();
any help will be greatly appreciated.
thanks
oz
Hi,
you could run a macro on the 'OnPostReload' trigger (see under Document Properties/Triggers).
- Ralf
Hi,
you could run a macro on the 'OnPostReload' trigger (see under Document Properties/Triggers).
- Ralf
if you are running the reload from a batch file then use the /l option
start C:\"Program Files"\QlikView\qv.exe /l your.qvw
hi Ralf,
thanks for the quick reply.
i wasn't aware of this functionality, its working great!
thank you for your help, this forum is a great!
oz
hi Michael,
the /l option leaves the document open at the end of the reload (this might be a problem) but it also didn't solve the export problem.
i was able to get it to work by calling the macro from the OnPostReload triger.
thanks for your help
oz
Hello, can you share the code that attaches the excel file to an email and sends it to a group of people ?
Thanks.