|
Variant xlApp, xlBooks, xlBook, xlSheets, xlSheet,VCell;
try
{
xlApp = CreateOleObject("Excel.Application.9");
}
catch (Exception &exception)
{
return;
}
xlApp.OlePropertySet("Visible", (Variant)true);
xlBooks = xlApp.OlePropertyGet("Workbooks");
xlBooks.OleProcedure("Add");
xlBook = xlBooks.OlePropertyGet("Item",(Variant) 1);
xlSheets = xlBook.OlePropertyGet("Worksheets");
xlSheet = xlSheets.OlePropertyGet("Item", (Variant)1);
VCell = xlSheet.OlePropertyGet("Cells", (Variant)1,(Variant) 1);
VCell.OlePropertySet("Value",(Variant)"SAAA");
xlBook.OleProcedure("Close");
xlApp.OleProcedure("Quit");
|