Solved

Using MFC to access MSOffice Object Models

Posted on 1998-09-02
2
257 Views
Last Modified: 2013-11-25
Easy Question:
How do I use the Office Object Models from with in
Visual C++, it's dead easy under VB - any ideas ???
0
Comment
Question by:dd021197
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1321597
It is as easy as VB with Visual C++ 5.0. Look into the Visual C++ 5.0 documentation: Visual C++\Visual C++ Programmer's Guide\Adding Program Functionality\Overviews\Compiler COM Support: Overview. And the Visual C++ Compiler COM Support Samples, especially "COMEXCEL: Demonstrates an Automation Client Application with Compiler COM Support".
0
 
LVL 23

Expert Comment

by:chensu
ID: 1321598
"COMEXCEL is a stand-alone Automation (formerly OLE Automation) client. It creates a new Microsoft Excel spreadsheet and generates a pie chart of the data stored on that spreadsheet. This sample works only with Microsoft Excel for Windows 95 version 7.0 or later, which exposes the dispinterfaces. It does not work with any previous versions of Microsoft Excel.

There is a Visual Basic project that controls the server in a way analogous to the COM code in Visual C++. You can compare the Visual Basic code with the code of this sample to see the similarities. You can use Visual Basic-specific object model documentation to write COM controllers in Visual C++.

To run this sample, you must edit the path to XL5EN32.OLB file in the source code.

This sample demonstrates the following keywords:

dispinterface; #import; _com_ptr_t; _variant_t; _bstr_t; _com_error."
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question