Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

to store the file in

Hello Guru's

As I wrote a macro to export the table content to excel file, the problem is I can store the file in my local machine but my requirement is when I click the button, the file will be stored in the network.

I am looking how the give the path with example.

Thanks in advance.

Joe

4 Replies
Not applicable
Author

Try export or exportex and then change the format parameter based on what you want. 5 I think is Excel format

set obj = ActiveDocument.GetSheetObject("CH01")

obj.ExportEx "C:\test.xls", 5

I hope this helps.

Not applicable
Author

The code is as in the below.

Sub to_excel

Dim wsname

Set XLApp = CreateObject("Excel.Application")

XLApp.Visible = false

Set XLDoc = XLApp.Workbooks.Add

wsname = ""

wsname = "Sheet1"

strFileName = "C:\test\Example1.xls"

ActiveDocument.ClearAll True

set obj = ActiveDocument.GetSheetObject("CH27")

obj.CopyTableToClipboard true

XLDoc.Sheets(wsname).Range("A7").Select

XLDoc.Sheets(wsname).Paste

XLApp.DisplayAlerts=false

XLDoc.SaveAs strFilename

XLDoc.Close

XLApp.Quit

end sub



Not applicable
Author

I've copied your code and tried it by changing C:\test to \\<Computer Name>\<ShareName>\exampl1.xlsx and it does work. I'm using QV Desktop btw.

Not applicable
Author

Thanks a lot... it works

Joe