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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
paul_ripley
Creator III
Creator III

Type mismatch: 'copyObjectsToExcelSheet'

Hello

I found this very useful article on how to send objects to excel using a macro

QlikTip #32: Exporting multiple QV objects to a single Excel document

However I get the above error message

Now I am a beginner with macros and I have seen that people have mentioned this also before and apparently there is some code I am missing from the article but I can see what I have done wrong

The below is what I copied directly from the article and changed to reflect my objects.

What code am I missing as I am really stuck!

Thanks

Paul

sub exportToExcel_Variant1

Dim aryExport(0,3)

aryExport(0,0) = "CH01"

aryExport(0,1) = "InvestmentPortfolio"

aryExport(0,2) = "A1"

aryExport(0,3) = "data"

Dim objExcelWorkbook 'as Excel.Workbook

Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)

end sub

2 Replies
settu_periasamy
Master III
Master III

Hi Paul,

I think your code is not completed.

copyObjectsToExcelSheet - not a Built-in Function. That is User Defined Function.

So, you need to Put the Complete Code..


There is a sample file which you have mentioned link  :  http://www.qlikblog.at/wp-content/uploads/2011/03/qlikblog_ExportToMultipleExcelSheets.zip


Capture.JPG


Let me know, if you are not able to download the file..

paul_ripley
Creator III
Creator III
Author

Thanks for your help

That helped me on the way

Paul