Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
avastani
Partner - Creator III
Partner - Creator III

Why is my macro not working?

The code below in the OnPostReload Trigger for Run Macro give me an error

Cannot open filename111009.csv for writing!

Does anyone know what I am doing is wrong?

sub exportList
set obj = ActiveDocument.GetSheetObject("TB01")
File = "'filename' & timestamp(now(), 'MMDDYY') & '.csv'")
obj.Export File, ";"
'obj.ServerSideExport File, ";"
end sub


I have set the Mofule Security & Local Security to Allow System Access. I am on a 64bit QV and will be pushing it to the server to make it auto export onpostreload. Thanks in advance for your help.

1 Reply
disqr_rm
Partner - Specialist III
Partner - Specialist III

You should provide comlete path. It seems, it's trying to save in some windows folders, which is not allowed, especially in Vista environment. Itried following and it works fine:

sub exp
set obj = ActiveDocument.GetSheetObject("TB01")
File = "C:\Temp\filename" & DatePart("M", timeStamp) & DatePart("D", timeStamp) & DatePart("YYYY", Date) & ".csv"
obj.Export File, ";"
end sub