Skip to main content

Create extra sheets in Excel in acucobol

  • January 24, 2013
  • 2 replies
  • 0 views

just started to use the following example code (so not so experienced with it)

* Create the OLE interface
    create @Application of @Excel handle in excel-app.
                         
* Don't show it yet!
    modify  excel-app @Visible = 0.

* Use this to create a new excel doc
    modify excel-app
           @Workbooks::Add()
           giving excel-doc.
            
* Get the worksheets collection
    inquire excel-doc sheets() in excel-sheets.

I would like to create more than the standard 3 worksheets in this document,  this can somebody inform me how I can do that, tried the next code but it does not work ....

    modify excel-doc
           @sheets::Add()
           giving excel-sheets

thanks in advance


#ExcelOLE

2 replies

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • January 24, 2013

just started to use the following example code (so not so experienced with it)

* Create the OLE interface
    create @Application of @Excel handle in excel-app.
                         
* Don't show it yet!
    modify  excel-app @Visible = 0.

* Use this to create a new excel doc
    modify excel-app
           @Workbooks::Add()
           giving excel-doc.
            
* Get the worksheets collection
    inquire excel-doc sheets() in excel-sheets.

I would like to create more than the standard 3 worksheets in this document,  this can somebody inform me how I can do that, tried the next code but it does not work ....

    modify excel-doc
           @sheets::Add()
           giving excel-sheets

thanks in advance


#ExcelOLE

modify excel-doc .@SheetsInNewWorkbook= 8


  • Author
  • Rocketeer
  • 19312 replies
  • January 25, 2013

just started to use the following example code (so not so experienced with it)

* Create the OLE interface
    create @Application of @Excel handle in excel-app.
                         
* Don't show it yet!
    modify  excel-app @Visible = 0.

* Use this to create a new excel doc
    modify excel-app
           @Workbooks::Add()
           giving excel-doc.
            
* Get the worksheets collection
    inquire excel-doc sheets() in excel-sheets.

I would like to create more than the standard 3 worksheets in this document,  this can somebody inform me how I can do that, tried the next code but it does not work ....

    modify excel-doc
           @sheets::Add()
           giving excel-sheets

thanks in advance


#ExcelOLE

Thanks a lot , works fine !