Solved

Using MFC to access MSOffice Object Models

Posted on 1998-09-02
2
250 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
  • 2
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
Comment Utility
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
Comment Utility
"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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
while loop over for loop 7 79
has22 challenge 11 70
matchUp  challenge 6 48
What is MicroStrategy.NET? 2 43
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now