Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
geogou1973
Creator
Creator

Insert the timestamp in the name of an export file from VBScript module

Hello.

I have the following VBScript module.

Can you tell me how can i insert the timestamp in the name of the exported file ?

like SALES_20150210 1605.txt

Sub ExportFiles

pathcorp="\\99.99.999.99\c$\SALES\"

vx=timestamp(now())

set corp = ActiveDocument.GetSheetObject("CH11")

corp.ServerSideExportEx  pathcorp & "SALES_" &vx& ".txt" , ";" , 1

end sub

I have change the setting in the script of the QVW file like below.

SET TimestampFormat='YYYYMMDD hhmm';

but does not work.

Can anyone help me ?

1 Solution

Accepted Solutions
rubenmarin

Hi Gou, I'm not sure if timestamp works, you can use:

vx=Year(Now()) & Right("0" & Month(Now()), 2) & Right("0" & Day(Now()), 2) & " " & Right("0" & Hour(Now()), 2) & Right("0" & Minute(Now()), 2)

View solution in original post

2 Replies
rubenmarin

Hi Gou, I'm not sure if timestamp works, you can use:

vx=Year(Now()) & Right("0" & Month(Now()), 2) & Right("0" & Day(Now()), 2) & " " & Right("0" & Hour(Now()), 2) & Right("0" & Minute(Now()), 2)

sathishkumar_go
Partner - Specialist
Partner - Specialist

Hi,

Create a variable and assign the value date(today()). And pass the variable in the macro.

Regards

Sathish