Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Date Value in a Variable VBScrpit

How to turn this command in vbscript?

let vDate = Date(Now(), 'YYMMDD');

11 Replies
Miguel_Angel_Baeyens

Leo,

It's not a QlikView issue, is a basic operating system issue: paths in Windows cannot have special characters as "/" or "\". As simple as that. So change your variable format in the macro

v = ActiveDocument.Evaluate("=date(today(),'YYYYMMDD')")

ActiveDocument.Variables("vDate").SetContent v, true

Then save the file as you are already doing. The file name will look like "Claro20111203.xls" which is perfectly readable by the filesystem

Hope that helps.

Miguel

Not applicable
Author

Do you have Requested Module Security set to "System Access" and Current Local security set to "Allow System Access" ?

If so, add other variable call vDate2 and assign value:   =date(vDate,'YYMMDD')

Then in your macro use:

vFile = ActiveDocument.Variables("vDate2").GetContent.String

XLDoc.SaveAs "c:\Qlikview\Claro"& vFile &".xls"

Hope this can help you.