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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Export table data to excel sheet using macro not working on QV11

I am trying to export table data to excel sheet using vb macro, I was able to do export using macro on qv9 server, after migrating same application on qv11 export is not working. do we need to do any additional set up to enable export data to excel using macro.Also Debug option is also not available in QV11 macro window.

1 Solution

Accepted Solutions
Not applicable
Author

Nishant

You will have to activate sheet first for saving Excel.

Use the following Macro:

Sub SendReport

ActiveDocument.Sheets("SH01").Activate 'edit the sheet 

'ActiveDocument.reload

set objExcel=ActiveDocument.GetSheetObject("TB03") 'edit the sheet object

strDate = Year(Date()) &"-"& month(date()) &"-"& Day(Date())

filepath="D:\Macros\Excel_"&strDate&".xls"   'edit the location of file

objExcel.ExportBiff filepath

ActiveDocument.GetApplication.Sleep 5000

End Sub

View solution in original post

12 Replies
Anonymous
Not applicable
Author

Hi Nishant,

Please can you attach macro

Not applicable
Author

Hi Nitha,

Please find attached test qvw.

Thanks

Nishant

ankit777
Specialist
Specialist

you may use the following macro..

sub Export

set obj1 = ActiveDocument.GetSheetObject("TB01")

obj1.ExportBiff "C:\Documents and Settings\596732\Desktop\manasvi\InnerJoin.xls"

msgbox("Done")

end sub

Not applicable
Author

Hi,

This Macro is giving message of done, but no excel is getting saved , I changed location to

obj1.ExportBiff "C:\InnerJoin.xls" , after that also no excel file is generated.

Thanks

Nishant

ankit777
Specialist
Specialist

Did you change the sheet object name?? In my case it is TB01. Your object id may be different.

Not applicable
Author

Hi Ankit,

Object name in my case is also TB01, Actually i think issue is with my set up of qv11 , bcoz same qvw is working on qv9 , only when I am running it on qv11 its behavior is changing. Is there any additional set up is required to enable excel export using macro?.

Thanks

Nishant

ankit777
Specialist
Specialist

Are you using version 9 and 11 on same machine or different? And which version of excel are you using?

Not applicable
Author

Hi,

version 9 and 11 are installed on two different machine, I am using excel 2013 on qv11 machine and excel 2007 in qv9 machine.

Thanks

Nishant

Not applicable
Author

Nishant

You will have to activate sheet first for saving Excel.

Use the following Macro:

Sub SendReport

ActiveDocument.Sheets("SH01").Activate 'edit the sheet 

'ActiveDocument.reload

set objExcel=ActiveDocument.GetSheetObject("TB03") 'edit the sheet object

strDate = Year(Date()) &"-"& month(date()) &"-"& Day(Date())

filepath="D:\Macros\Excel_"&strDate&".xls"   'edit the location of file

objExcel.ExportBiff filepath

ActiveDocument.GetApplication.Sleep 5000

End Sub