0 Replies Latest reply: Jan 17, 2018 11:54 AM by souad ouertani RSS

    export table to excel file

    souad ouertani


      Ihave i straight table and list selection (Agence),  So i need for every selection value export the table to excel sheet for example


      agence 01

      agence 02

      agence 03


      i need to have in my excel file 3 sheet


      I started with this script :


      Sub export_situation()

      set val=ActiveDocument.Fields("%ID_AGENCE_CTOS_CLIENT").GetPossibleValues

      for i=0 to val.Count-1

      ActiveDocument.Fields("%ID_AGENCE_CTOS_CLIENT").Select (val.Item(i).Text)

      set objagenceClient = ActiveDocument.GetSheetObject("CH173")


      Dim aryExport(val.Count-1,3)

      aryExport(i,0) = "objSalesPerYearAndRegion"

      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 


      So how modify the script to get every shet for every agence


      Ce message a été modifié par : souad ouertani


      Ce message a été modifié par : souad ouertani