 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Stefan Guest
|
Posted: Tue Jan 04, 2005 8:34 am Post subject: Adding a Excel Worksheet to a Workbook in Delphi 7 |
|
|
I used the following Lines of code in Delphi5 that worked fine to open
multiple sheets in my workbook, but now I have started going over to
delphi 7 and now I get an OLE error 800A03EC when the line with the
#'s is executed at runtime.
Any body have a clue what the problem is?
where
bookBS: TExcelWorkbook;
excelBS: TExcelApplication;
sheetBSH: TExcelWorksheet;
sheetBSL: TExcelWorksheet;
begin
LCID := GetUserDefaultLCID;
excelBS.Connect;
excelBS.Visible[LCID] := true;
bookBS.ConnectTo(excelBS.Workbooks.Add(xlWBATWorksheet, LCID));
sheetBSL.ConnectTo(bookBS.Worksheets[1] as _Worksheet);
sheetBSL.Name := NewModel.Name + '-Low';
sheetBSH.ConnectTo(bookBS.Sheets.Add(1, 1, 1, xlWBATWorksheet, LCID)
as _Worksheet); ## --- error when this line executes
sheetBSH.Name := NewModel.Name + '-High';
....
end;
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|