Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro error paste

I have this macro for export an Excel.

sub ExportExcel()

 

  Set xlApp = CreateObject("Excel.Application")

                    xlApp.Visible = true

 

                    Set xlDoc = xlApp.Workbooks.Add()

 

                    'Create the new sheet and the content in the sheet

                    Set xlSheet = xlDoc.Worksheets.Add

                     xlSheet.Name = "SheetFromExcel"

 

 

   

                    Set SheetObj = ActiveDocument.GetSheetObject("CH29")

                    SheetObj.CopyTableToClipboard true

                    xlSheet.Paste

 

          set xlApp = ActiveDocument.GetSheetObject("CH29")

          xlApp.ExportEx "C:\Proyecto QlikView\Reporte.xls" ,4

          ActiveDocument.ClearAll

The problem is that sometimes that exports ok, but sometimes trigger an error. That says something like "Macro parse failed. Functionality was lost. ExportExcel. Error with the Paste method from Worsheet class".

For example, if I change the qvw name, doesn't work or if I set the pivot table seems visible, neither.

How can I solution this issue?

Thanks.

4 Replies
Not applicable
Author

sub a

'ActiveDocument.clearall

''path="D:\Ananth\WORKING\Migration_Testing\Generated_Files\Production_PDF\GWP_Detailed_FTD_Report"&".XLS"

''set lb = ActiveDocument.GetSheetObject("CH396")

''lb.ExportBiff path

end sub

Not applicable
Author

please try this one

Anonymous
Not applicable
Author

Mmm, that doesn't work, I mean works but sometimes, like before.

Do you know another solution?

Thanks.

Not applicable
Author

Hi,

I'm having the same problem, sometimes it runs fine and sometimes (most of the time) it runs in a error.

"Macro parse failed. Functionality was lost. ExportExcel. Error with the Paste method from Worsheet class"

Did you found a sollution for this problem?

Thanks in advance.