How to use MFC to automate Excel and create and format a new workbook (179706)
The information in this article applies to:
- Microsoft Excel 2000
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- The Microsoft Foundation Classes (MFC)
- Microsoft Office XP Developer
- Microsoft Office 2000 Developer
- Microsoft Excel 2002
- Microsoft Excel 97 for Windows
This article was previously published under Q179706 SUMMARY This article shows how to automate Microsoft Excel using
the Microsoft Foundation Class (MFC) library, version 4.2 (installed with
Microsoft Visual C++ versions 5.0 and 6.0). The article describes a
technique for using OLE automation to create/format a Microsoft Excel workbook;
it introduces several methods/properties (from the Microsoft Excel type
library) for adding data to the worksheet and formatting the
worksheet. Notes for Automating Microsoft Excel 2000 and 2002 The sample code in this article uses class wrappers generated
from the Excel 97 object library (Excel 8.olb). With slight modification, this
code can be applied to an Automation client that uses class wrappers for Excel
2000 (Excel9.olb) or Excel 2002 (Excel.olb). For additional information about
using the sample code described in this article with the Microsoft Excel 2000
or 2002 type library, please click the article number below to view it in the
Microsoft Knowledge Base: 224925 INFO: Type Libraries for Office May Change with New Release
Modification Type: | Minor | Last Reviewed: | 12/1/2004 |
---|
Keywords: | kbnewfile kbfunctions kbProgramming kbAutomation kbhowto kbinterop KB179706 |
---|
|