[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.



