Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to make an export of a table to a .txt file. The location for the exportfile need to be variable.
In VBScript I've the following code:
SUB TestExport
' The QlikView object
Set obj = ActiveDocument.GetSheetObject("ExportTXT")
' The variable for the export location of the file
set v = ActiveDocument.Variables("vLocationTXT")
set loc = v & "\Exportfiles"&" "&day(now())&"-"&month(now())&"-"&year(now())&"_"& hour(now()) &"-"& minute(now())&"-"& second(now())& ".txt"
END SUB
But this didn't work. Does anyone have a solution for this?
Thanks in advance,
Wiegert
Wiegert,
First, it should be
set loc = v.GetContent.string & ...
Next, the export itself:
obj.Export loc
(I'm not sure about the exact syntax of the last one, give it a try...)
Wiegert,
First, it should be
set loc = v.GetContent.string & ...
Next, the export itself:
obj.Export loc
(I'm not sure about the exact syntax of the last one, give it a try...)
Hi Michael,
thanks for your reply. The following code works:
SUB TestExport
' The QlikView object
Set obj = ActiveDocument.GetSheetObject("ExportTXT")
' The variable for the export location of the file
set v = ActiveDocument.Variables("vLocationTXT")
loc = v & "\Exportfiles"&" "&day(now())&"-"&month(now())&"-"&year(now())&"_"& hour(now()) &"-"& minute(now())&"-"& second(now())& ".txt"obj.Export loc , "="
END SUB
Thanks,
Wiegert