PLEASE HELP! TExcelApplication/Workbook/Worksheet Cells randomly updating


2005-08-11 10:15:40 PM
cppbuilder87
Please help.
I am trying to transfer around 200 fields to Excel from CBuilder 6.0.
My code works in workbooks that don't have too many formulas already
setup in the workbook or if 'Auto Calculate' is turned off in the workbook.
So perhaps someone could be so kind to help me with one of two problems
(or both!):
1) How can I turn the auto calculate feature on and off in Excel from
CBuilder?
or
2) How can I force Excel to handle all my messages or how can I know it
is too busy to receive more commands? I'm basically doing the following
alot:
ExcelWorksheet1->Cells->set_Item((TVariant)row,
(TVariant)numericcolumn,(TVariant)value);
The above (when properly connected to a Excel App, Excel Workbook, and
sheet, via the following, does not seem to work consistently on large
workbooks with a lot of calculations in it:
ExcelApplication1->Connect();
ExcelWorkbook1->ConnectTo(ExcelApplication1->Workbooks->Open((WideString)FullWorkbookPath));
ExcelWorksheet1->ConnectTo(ExcelWorkbook1->Worksheets->get_Item((TVariant)sheetindex));
Any ideas?