Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
rominavilla
New Contributor III

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

Re: Macro error paste

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

Re: Macro error paste

please try this one

rominavilla
New Contributor III

Re: Macro error paste

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

Do you know another solution?

Thanks.

Not applicable

Re: Macro error paste

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.