Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to export in csv with today's date in file name

Hi All,

thanks in advance firstly,

Actually i need a code of macro which export my object in CSV form and today's date should be added to the name of file

for ex : file name is FPH Report.csv

so i want this to be FPH 17-12-2013.csv

Regards

Sachin

1 Reply
Anonymous
Not applicable
Author

You can use this code,

sub Export

Dim docProp

set docProp = ActiveDocument.GetProperties

Dim tmpFile  'used to create relative filepaths

tmpFile = docProp.MyWorkingDirectory

Dim vSpl  'location of final backslash char

vSpl = InStrRev(tmpFile,"\")

tmpFile = Left(tmpFile,vSpl) & "Folder1\Folder2\Filename_" & right(Date, 4) & left(Date, 2) & mid(Date, 4,2) & ".csv"    

set obj = ActiveDocument.GetSheetObject("CH02")

obj.ExportBiff tmpFile

end sub