Origin Ver. 8.5.1 and Service Release 1:
Operating System: Win XP
Hi,
void WriteToExcel()
{
Object oExcel;
oExcel = CreateObject("excel.application");
oExcel.Visible = true;
string strFilePathExcelTemplate = "c:\\Temp\\ExcelTemplate.xlt";
Object oExcelWkbks, oExcelWkbk, oRange;
Object oExcelWksh1;
oExcelWkbks = oExcel.Workbooks;
oExcelWkbk = oExcelWkbks.Open(strFilePathExcelTemplate);
oExcelWksh1 = oExcelWkbk.Worksheets(1);
oExcelWksh1.Cells(2,3) = "Test Cell 2, 3"; // row, col
}
worked fine using Origin 8.1. Same code does not work anymore using 8.5.1.
Strange behavior: first argument seems to be used as columns while all strings are written to first row.
How can I write to excel successfully? Usually .Value is appended to the Cells() command, but does not work with 8.1 and 8.5.1 either. .Value seems right for reading cells as OriginLab's sample (ReportCreation.c) demonstrates.