Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Export with the field name.

Hello

I created a macro that exports a spreadsheet to excel.
I need the file name. XLS is the field name that is selected in the "select multiple filters.

Can anyone help??

call exportToExcel("CH209", "C:\Temp\FILE NAME.xls")

2 Replies
Not applicable
Author

What is Select Multiple Filters? Is that a field?

Your current macro is very hard to read, but here is a snippet of code that should work:

set mySelections = ActiveDocument.Fields("Field").GetSelectedValues
fileName = mySelections.Item(0).text
exportToExcel("CH209", "C:\Temp\" & fileName)


You would want to put in some error checking to verify that one item is selected.

Anonymous
Not applicable
Author

FOLLOW COMPLETE MACRO

Sub exportObject1 sub ()
exportToExcel call ("CH209", "C: \ Temp \ FILE Name.xls)
End Sub


sub exportToExcel (objectId, filePath)
dim the
Set o = ActiveDocument.GetSheetObject (objectId)
o.ExportBiff filePath
Set o = nothing
End Sub