In the archived forums there is a great example of controlling excel through ole automation.
I have used the sample program from time to time with out a problem, however I am trying to duplicate a VBA macro that formats a header row nicely. I have most of it working except "AutoFit" and "FreezePanes". AutoFit is more important to me than FreezePanes.
Here is the VB code:
.ColorIndex = 37
.Pattern = xlSolid
Selection.Font.Bold = True
ActiveWindow.FreezePanes = True
Here is the reevant parts of the COBOL code:
INQUIRE EX-WORKBOOK @Worksheets::Item(1) IN EX-WORKSHEET.
INQUIRE EX-WORKSHEET @Range("A3:O3") IN EX-RANGE.
MODIFY EX-RANGE @Font::Bold = 1.
MODIFY EX-RANGE @Interior::ColorIndex = 37.
MODIFY EX-RANGE @Interior::Pattern = @xlSolid.
MODIFY EX-RANGE @AutoFilter = 1.
* MODIFY EX-RANGE @AutoFit.
* MODIFY EX-WORKSHEET @FreezePanes = 1.
It works with AutoFit and FreezePanes remarked out.