Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have a macro that exports a file QVD with the employee's name
.
Now I want to add the variable VR_MES the file name that returns months and years.
Employee 02 2011.QVD
sub export_Venda
set obj = ActiveDocument.GetSheetObject("CH14")
set val=ActiveDocument.Fields("Employee").GetPossibleValues
FUNCIONARIO = val.Item(i).Text
obj.ExportEx "D:\Desenv\Qvd_Planejamento_Compra\Venda_"&Employee&".qvd", 4
msgbox("Dados exportados com sucesso")
end sub
Hi,
First make sure that the variable stores the date properly, and not the numeric format of QlikView nor decimals (dates with times).
Then add in the macro the lines corresponding to the reading of the variable and the path modification:
Sub export_Venda Set obj = ActiveDocument.GetSheetObject("CH14") Set val = ActiveDocument.Fields("Employee").GetPossibleValues Set vFecha = ActiveDocument.Variables("vDateVariable") vFecha = vFecha.GetContent.String FUNCIONARIO = val.Item(i).Text obj.ExportEx "D:\Desenv\Qvd_Planejamento_Compra\Venda_"&Employee&"_"&vFecha&".qvd", 4 MsgBox("Dados exportados com sucesso") End Sub
Hope that helps.