Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have this macro that exports the table in one excel's file, i want that excel's file Name keep the last value of one table's field.
For example: Field A: 2010;2011;2012 the name will be 2012.
Sub exportExel
dim ls_date
set ExcelSheetApp = CreateObject("Excel.Application")
ExcelSheetApp.Visible = false
set ExcelWB= ExcelSheetApp.Workbooks.Add
ExcelWB.Sheets(1).name = "Storico"
set XLSheet = ExcelWB.Worksheets(1)
set QVData = ActiveDocument.GetSheetObject("CH01")
set XLSheet = ExcelWB.Worksheets(1)
QVData.CopyTableToClipboard true
XLSheet.Paste XLSheet.Range("A1")
ExcelWB.SaveAs "C:\Users\ut0854\Desktop\Qlik Omicron\Diagnostico\Storico\NAME OF FILE.xlsx", 51
ExcelWB.Close
ExcelSheetApp.Application.Quit
End Sub
This is from the API Guide:
set v = ActiveDocument.Variables("Variable1")
msgbox(v.GetContent.String)
You might store the Max of field A in a variable and use the variable value in the macro to get the filename.
Ok thanks.
But after i have created the variable
varmax = Max(Date(DataComp1,'DD/MM/YYYY'))
How can i use the value of this variable in the macro?
This is from the API Guide:
set v = ActiveDocument.Variables("Variable1")
msgbox(v.GetContent.String)
thanks a lot
for your kindness