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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Export chart to excel via macro, with todays date as part of filename

Sirs,

I try to export the values from at bar chart to an excel file via macro. It works, until i want the date of today to be a part of the filename, eg. "Testprognose_011013.xls" 

Searching the forum i have found something like this but cant get it to work.

vToday is defined as date(today(2))

'set obj = ActiveDocument.GetSheetObject("CH289")
'set bb = ActiveDocument.Variables("vToday")
'mydatevar = bb.GetContent.String
'File = "C:\Users\jju\Desktop\testprognose"&[mydatevar]&".xls"
'obj.ExportEx File, ";"

Any insights?

1 Solution

Accepted Solutions
Not applicable
Author

Hi, this should work.

  ActiveDocument.RecallDocBookmark "Report1"

  ActiveDocument.GetApplication.WaitForIdle

  ActiveDocument.Sheets("SH02").Activate 

  ActiveDocument.GetApplication.WaitForIdle

 

  set obj = ActiveDocument.GetSheetObject("CH02")

  ActiveDocument.GetApplication.WaitForIdle

  obj.ExportBiff "\\Path\" & "My document name " & Year(Now())& Right("0" & Month(Now),2) & Right("0" & Day(Now),2) & ".xls"

View solution in original post

2 Replies
Not applicable
Author

Hi, this should work.

  ActiveDocument.RecallDocBookmark "Report1"

  ActiveDocument.GetApplication.WaitForIdle

  ActiveDocument.Sheets("SH02").Activate 

  ActiveDocument.GetApplication.WaitForIdle

 

  set obj = ActiveDocument.GetSheetObject("CH02")

  ActiveDocument.GetApplication.WaitForIdle

  obj.ExportBiff "\\Path\" & "My document name " & Year(Now())& Right("0" & Month(Now),2) & Right("0" & Day(Now),2) & ".xls"

Not applicable
Author


Wonderful, thanks a lot.