6 Replies Latest reply: Mar 11, 2016 1:46 AM by Marcus Sommer RSS

    Export button notworking through Macros

    appi karna

      Hi all,

       

      In one of the report after hitting the export button out 2000 records from the straight table only 6 records doesn't gets exported on an excel sheet. But when I do a right click and send to excel I get all the 2000 records. Not sure why it's happening, can somebody please guide. I checked my data model files and all records are present in the data model. Below is the macros for the export button:

       

       

      sub exportToExcel

      dim o
      ExportPath = ActiveDocument.Variables("vExportPath").GetContent.String
      ObjectID = ActiveDocument.Variables("vObjectID").GetContent.String
      ChartName = ActiveDocument.GetSheetObject(ObjectID).GetCaption.Name.v
      Set o = ActiveDocument.GetSheetObject(ObjectID)
      o.ExportBiff ExportPath & ChartName & ".xls"

      Set o = nothing


      end sub