Skip to main content

[archive] Question on the EXCEL.def file

  • September 11, 2007
  • 17 replies
  • 0 views

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.

17 replies

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
This is my first Acucorp GUI program that will open, write, and then close an EXCEL file.

My GUI program, using acuthin, will prompt the user for a date range, read the information from a Acucorp vision file on the Unix server and then create and EXCEL file on the users PC that is running under Windows XP.

My Acucorp COBOL source code will reside and be compiled on the Unix server.

I have started out with a simple program that and I will build on this program. My program is very similar to the excel-ole.cbl.

When I compile this program, I keep getting errors on the EXCEL.def file. The EXCEl.def file was created using the Axdefgen utility. This EXCEL.def file was then moved to the copy library on the unix system.

../../COPYLIBS/EXCEL.def, line 283: RETURNING expected, NEWENUM found
../../COPYLIBS/EXCEL.def, line 283: PROCEDURE expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: DIVISION expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: identifier expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: Missing PARA/SECTION
../../COPYLIBS/EXCEL.def, line 283: Can't recover, good bye!

I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
This is my first Acucorp GUI program that will open, write, and then close an EXCEL file.

My GUI program, using acuthin, will prompt the user for a date range, read the information from a Acucorp vision file on the Unix server and then create and EXCEL file on the users PC that is running under Windows XP.

My Acucorp COBOL source code will reside and be compiled on the Unix server.

I have started out with a simple program that and I will build on this program. My program is very similar to the excel-ole.cbl.

When I compile this program, I keep getting errors on the EXCEL.def file. The EXCEl.def file was created using the Axdefgen utility. This EXCEL.def file was then moved to the copy library on the unix system.

../../COPYLIBS/EXCEL.def, line 283: RETURNING expected, NEWENUM found
../../COPYLIBS/EXCEL.def, line 283: PROCEDURE expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: DIVISION expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: identifier expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: Missing PARA/SECTION
../../COPYLIBS/EXCEL.def, line 283: Can't recover, good bye!

I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
This is my first Acucorp GUI program that will open, write, and then close an EXCEL file.

My GUI program, using acuthin, will prompt the user for a date range, read the information from a Acucorp vision file on the Unix server and then create and EXCEL file on the users PC that is running under Windows XP.

My Acucorp COBOL source code will reside and be compiled on the Unix server.

I have started out with a simple program that and I will build on this program. My program is very similar to the excel-ole.cbl.

When I compile this program, I keep getting errors on the EXCEL.def file. The EXCEl.def file was created using the Axdefgen utility. This EXCEL.def file was then moved to the copy library on the unix system.

../../COPYLIBS/EXCEL.def, line 283: RETURNING expected, NEWENUM found
../../COPYLIBS/EXCEL.def, line 283: PROCEDURE expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: DIVISION expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: identifier expected, RETURNING found
../../COPYLIBS/EXCEL.def, line 283: Missing PARA/SECTION
../../COPYLIBS/EXCEL.def, line 283: Can't recover, good bye!

I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
Is Excel.def in the COBOL program under special-names?

Does the porogram compile on Windows?

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
Is Excel.def in the COBOL program under special-names?

Does the porogram compile on Windows?

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
Yes, the EXCEL.def is under SPECIAL-NAMES.

I moved the source program from the unix server to inside Acubench and compiled the program. There were no compile errors.

Do I need to keep the source program in Acubench?

I would prefer to keep all my COBOL source code on the unix server. We have a lot of HP MPE calls (SpeedWare AMXW) in our source programs. We were on a server running MPE before converting to unix. Most of our flat screens were converted from VPLUS on the MPE system to EdWin on the unix system. Our Acucorp compiler on the unix server has been altered to recognize the AMXW calls.

I am just now starting to convert the EdWin flat screens to GUI screens called through Acuthin.

Any thoughts or suggestions?

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
Yes, the EXCEL.def is under SPECIAL-NAMES.

I moved the source program from the unix server to inside Acubench and compiled the program. There were no compile errors.

Do I need to keep the source program in Acubench?

I would prefer to keep all my COBOL source code on the unix server. We have a lot of HP MPE calls (SpeedWare AMXW) in our source programs. We were on a server running MPE before converting to unix. Most of our flat screens were converted from VPLUS on the MPE system to EdWin on the unix system. Our Acucorp compiler on the unix server has been altered to recognize the AMXW calls.

I am just now starting to convert the EdWin flat screens to GUI screens called through Acuthin.

Any thoughts or suggestions?

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
I'm not an HP3000 expert but I though that HP 3000 referenced copybooks differently (archived in a COPYLIB). When compiling a simple COBOL program (developed in AcuBench or just on Windows) using copybooks are you able to compile on Unix? If not it seems to be that the Unix environment is not correct. Is COPYPATH being used or the compile -Sp option so that copybooks can be found?

You may want to contact Technical Support.

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
I'm not an HP3000 expert but I though that HP 3000 referenced copybooks differently (archived in a COPYLIB). When compiling a simple COBOL program (developed in AcuBench or just on Windows) using copybooks are you able to compile on Unix? If not it seems to be that the Unix environment is not correct. Is COPYPATH being used or the compile -Sp option so that copybooks can be found?

You may want to contact Technical Support.

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
I'm not an HP3000 expert but I though that HP 3000 referenced copybooks differently (archived in a COPYLIB). When compiling a simple COBOL program (developed in AcuBench or just on Windows) using copybooks are you able to compile on Unix? If not it seems to be that the Unix environment is not correct. Is COPYPATH being used or the compile -Sp option so that copybooks can be found?

You may want to contact Technical Support.

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
This is the compile statement on the unix server.

ccbl -w -x -o @.acu -Lo @.lst -Lf -e @.err -Sp ../../COPYLIBS -Cp -Ca -Di
-Dci -Dz -Ga -Zd $1.cbl

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
This is the compile statement on the unix server.

ccbl -w -x -o @.acu -Lo @.lst -Lf -e @.err -Sp ../../COPYLIBS -Cp -Ca -Di
-Dci -Dz -Ga -Zd $1.cbl

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
Try compiling without any compile switch, if it makes a difference, start adding switches until you see what causes the error.

Btw, -Ga and -Zd does the same thing. -Zd is reduntant, you can remove that.

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
Try compiling without any compile switch, if it makes a difference, start adding switches until you see what causes the error.

Btw, -Ga and -Zd does the same thing. -Zd is reduntant, you can remove that.

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
It was the -Cp switch causing the problem. After removing this swith, it compiled clean.

Thanks.

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
It was the -Cp switch causing the problem. After removing this swith, it compiled clean.

Thanks.

[Migrated content. Thread originally posted on 11 September 2007]

... When I compile this program, I keep getting errors on the EXCEL.def file.
...
I keep getting compile errors at the following line. Not sure why?
* _NewEnum
PROPERTY-GET, -4, @_NewEnum
RETURNING "IUnknown*", TYPE 13


There are so many things that can cause this, without seeing neither your program nor the .def file, it is almost impossible to state the cause.

One thought I have is that you refer to HP, do you use any compiler switches that are HP specific?

At any rate, can you try to compile this example and see if that works (no compiler switches):

       IDENTIFICATION DIVISION.
       PROGRAM-ID. ExcelHelloWorld.
      *====================
      *
      * Copyright (c) 1996-2001 by Acucorp, Inc.  Users of ACUCOBOL
      * may freely modify and redistribute this program.
      *
      * The purpose of this application is to show the absolute minimum
      * required to access a cell in a Microsoft Excel spreadsheet.
      *
       ENVIRONMENT DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "EXCEL.def".
                   .
       DATA        DIVISION.
       WORKING-STORAGE              SECTION.
       77  olExcel                  HANDLE OF APPLICATION.
       77  olWrkSh                  HANDLE OF WORKSHEET.
       77  olWrkBk                  HANDLE OF WORKBOOK.

       PROCEDURE DIVISION.
       Main.
           CREATE   Application      OF Excel
                        HANDLE           IN olExcel.
           MODIFY   olExcel          @Visible = 1.
           MODIFY   olExcel          Workbooks::Add()
                        GIVING           olWrkBk.
           INQUIRE  olWrkBk          Worksheets::Item(1) IN
                        olWrkSh.
           MODIFY   olWrkSh          Range("A1")::Value = "Hello world".

           ACCEPT   OMITTED.
           DESTROY olWrkSh.
           MODIFY   olWrkBk          @Close(BY NAME SaveChanges 0).
           DESTROY olWrkBk.
           MODIFY   olExcel          Quit().
           DESTROY olExcel.
           GOBACK.
It was the -Cp switch causing the problem. After removing this swith, it compiled clean.

Thanks.