|
The program needs to add a new feature: writing data to EXCEL documents, requiring Office Automation instead of ODBC.
I found some sample code for this in the internet:
// TODO: Add your control notification handler code here
_Application ExcelApp;
Workbooks wbsMyBooks;
_Workbook wbMyBook;
Worksheets wssMysheets;
_Worksheet wsMysheet;
Range rgMyRge;
// Create Excel 2000 server (start Excel)
if (! ExcelApp.CreateDispatch ("Excel.Application", NULL))
{
AfxMessageBox ("Failed to create Excel service!");
exit (1);
}
ExcelApp.SetVisible (false);
// Create a new document using a template file
char path [MAX_PATH];
GetCurrentDirectory (MAX_PATH, path);
CString strPath = path;
strPath + = "\\template1";
wbsMyBooks.AttachDispatch (ExcelApp.GetWorkbooks (), true);
wbMyBook.AttachDispatch (wbsMyBooks.Add (_variant_t (strPath)));
...
...
May I ask: _Application :: CreateDispatch (), _Application :: SetVisible (), _Workbook :: AttachDispatch, etc., what kind of functions do they implement? What is the parameter list? How can I not find help on them in MSDN? |
|