I found some examples on how to handle Excel worksheets from Axapta:
Hope that you will find this useful enough:
{
SysExcelApplication SysExcelApplication; SysExcelWorksheet SysExcelWorksheet; SysExcelWorksheets SysExcelWorksheets; SysExcelWorkbooks SysExcelWorkbooks; SysExcelWorkbook SysExcelWorkbook; SysExcelRange SysExcelRange; SysExcelCell SysExcelCell; SysExcelCells SysExcelCells;
COMVariant COMVariant1;
#excel ;
sysExcelApplication = SysExcelApplication::construct();
sysExcelApplication.visible(true);
sysExcelWorkbooks = sysExcelApplication.workbooks();
// for filename
COMVariant1 = new COMVariant();
COMVariant1.bStr("D:\\data\\excel\\axamuster.xlt");
sysExcelWorkbook = sysExcelWorkbooks.add(COMVariant1);
SysExcelWorksheets = sysExcelWorkbook.worksheets();
SysExcelWorksheet = SysExcelWorksheets.itemFromNum(1);
SysExcelRange = SysExcelWorksheet.cells().range(#ExcelTotalRange);
SysExcelCell = SysExcelWorksheet.cells().item(4,2);
// Value to Cell SysExcelCell.value(12);
SysExcelCell = SysExcelWorksheet.cells().item(4,3); // Value to Cell SysExcelCell.value(23);
}
Med venlig hilsen
Mikael Dalgård
-----Oprindelig meddelelse-----
Fra: Amar Kumar Senapati [mailto:[EMAIL PROTECTED] Sendt: 16. september 2003 12:42
Til: [EMAIL PROTECTED]
Emne: [development-axapta] How to Clear data from a worksheet of an Excel workbook
Hi All, I am using COM objects for entering one tables data to a worksheet of a excel work book.( MS excel XP). I want to clear this data from the excel work sheet before writing on the same work sheet.I don’t want to overwrite the data. First clear then write. Can you tell me which method or what I will do to clear the data from an existing worksheet.I am able to Overwrite but not clearing the data. I am using COM and COMvariant objects. Looking for a help Regards Amar
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Yahoo! Groups Sponsor ADVERTISEMENT
Click Here!
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

