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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
w_heres
Partner - Contributor II
Partner - Contributor II

Export to txt with variable location

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

1 Solution

Accepted Solutions
Anonymous
Not applicable

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...)

View solution in original post

2 Replies
Anonymous
Not applicable

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...)

w_heres
Partner - Contributor II
Partner - Contributor II
Author

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