Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I was trying to find a Macro example to Export field from a table into a .txt file from Qlikview document when the Qlikview document resides in the accesspoint.
I can save a .txt file in my local machine using the below macro But dont know how it works when the Document is deplyed to production. How the users can press a button and it will prompt to download a text file based on the selection of the users? Is it possible to achieve?
Sub Export
ActiveDocument.Sheets("SH02").Activate
set obj = ActiveDocument.GetSheetObject("TB02")
filepath="C:\test\test.txt"
obj.Export filepath,4
ActiveDocument.GetApplication.Sleep 5000
End Sub
Can anyone help me with this?
Thanks,
Ahmed
Within the actions by extern is an export-possibilty from selectable fields (not objects but by a tablebox there are only fields, too) into a txt-file.
- Marcus
This macro will loop thru objects in Sheet "Main" and will send object with Caption Name specified by userinput
Sub Export
set s=ActiveDocument.Sheets("Main")
name = ActiveDocument.GetApplication.InputBox("Enter name of the object?")
Objects = ActiveDocument.ActiveSheet.GetSheetObjects
For j = lBound(Objects) To uBound(Objects)
set obj = Objects(j)
IF obj.GetCaption.Name.v = name Then
filepath="C:\test\"&name&".txt"
obj.Export filepath,4
else
end if
next
End Sub
You can add listbox with objects in the sheet so user knows names of the objects.
make sure that all objects have caption name
Hi Mika,
Thanks for your nice feedback. I can get a text file in my local machine with piece of code i have already mentioned. My problem is, when i press the web mode on it doesnt work. What i mean is, If i deploy the Dashboard in production, will the macro going to work in the accesspoint? Is it going to prompt a download option of the specified object in text file?
Thanks again.
Ahmed
Within the actions by extern is an export-possibilty from selectable fields (not objects but by a tablebox there are only fields, too) into a txt-file.
- Marcus
Marcus,
Although I wanted to have some kind of prompt to download the Field in a text file But your solution still do the trick for me.
Excellent!
Thank you so much.
Ahmed