Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ssriramin19
Contributor III
Contributor III

error in macro

Hi ,

I am using the below macro for export to excel using button .I am getting the error in below code

 

Set

objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)

The full macro code is

 

sub exportToExcel_Variant1


Dim aryExport(0,3)


aryExport(0,0) = "Supply Plan Waterfall"    
'aryExport(0,1) = "Sales per Region a. Year"
aryExport(0,2) = "A1"
aryExport(0,3) = "data"

Dim objExcelWorkbook 'as Excel.Workbook
Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)

end sub

Can anyone please help me how to resolve the above error?

1 Reply
er_mohit
Master II
Master II

for set object corresponds to  xl. using this code with replace of your excel code

Set objXL = CreateObject(“Excel.Application”)

hope it will helps you