Solved

Using MFC to access MSOffice Object Models

Posted on 1998-09-02
2
256 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pre4 challenge 19 116
Question to Pivot table 1 73
How do ASP.NET and MVC work together? 4 76
Infrastructure development vs software development 3 107
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…

739 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