Office 2007 upgrade breaks 4GL Progress code
I'm supporting some legacy 4GL Progress code. One of our servers that runs 4GL was upgraded to Office 2007 without my knowledge (nice, right?). Anyway, the upgrade broke a segment of code that's running the excel.application COM component. Finance maintains a list of sales forecast numbers that they keep in an Excel document and the following code loads those numbers:
CREATE
"Excel.application" chExcelApplication NO-ERROR.
ASSIGN
chExcelApplication:VISIBLE = NO NO-ERROR.
ASSIGN
chWorkbook = chExcelApplication:Workbooks:OPEN(STRING(i-infile)) NO-ERROR.
ASSIGN
chWorkSheet = chExcelApplication:Sheets:ITEM((1)) NO-ERROR.
IF input frame f-in Plan1 <> 0 THEN
Plan1 = input fra开发者_C百科me f-in Plan1.
ELSE
Plan1 = chWorkSheet:range(forecastColumn + "4"):VALUE.
IF input frame f-in Plan2 <> 0 THEN
Plan2 = input frame f-in Plan2.
ELSE
Plan2 = chWorkSheet:range(forecastColumn + "7"):VALUE.
IF input frame f-in Plan3 <> 0 THEN
Plan3 = input frame f-in Plan3.
ELSE
Plan3 = chWorkSheet:range(forecastColumn + "6"):VALUE.
When the code runs I get the following error:
"Invalid component-handle referenced while processing method/statement: Range."
The weird thing is that A) It doesn't fail on the "Open" command or the "Create" command - so it doesn't seem to be a problem with the COM object itself. And B) if i run the same code from my machine that also runs Office 2007, it runs just fine.
Any ideas on how I can troubleshoot this one?
Thanks!
I copied the contents of the excel into a new file, and it's pulling the numbers just fine now. Weird...
精彩评论