1 Reply Latest reply: Jan 18, 2018 3:29 AM by Marcus Sommer RSS

    Type Mismatch on copyObjectsToExcelSheet

    souad ouertani

      i used this script to copy table to excel



      Sub export_situation()

      set val=ActiveDocument.Fields("souad").GetPossibleValues

      for i=0 to val.Count-1



      ActiveDocument.Fields("souad").Select (val.Item(i).Text)



      set objagenceClient = ActiveDocument.GetSheetObject("tablesouad")




      Dim aryExport(6,3)







      aryExport(i,0) = "tablesouad"



      aryExport(i,1) = val.Item(i).Text



      aryExport(i,2) = "A1"



      aryExport(i,3) = "data"





      Dim objExcelWorkbook 'as Excel.Workbook



      Set objExcelWorkbook = copyObjectsToExcelSheet(ActiveDocument, aryExport)








      end Sub


      but i have this error