Solved

Excel automation controller

Posted on 1998-03-31
1
385 Views
Last Modified: 2013-12-04
I am trying to use Visual C++ 5.0 to create an automation controller for Microsoft Excel.  The code that I have is API based some using MFC would be difficult at best.  While poking through the Visual C++ help files, I came across the #import directive, and was excited to see that this compiler directive would generate wrapper classes for me based on a type library file.  When I added "#import ..\excel8.olb" and tried to compile I got and undeclared identifier on MsoRGBType.  My guess is that I need to #import another file before excel8.olb.  Is this correct and if so which file is it?
0
Comment
Question by:derekl
[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
1 Comment
 
LVL 23

Accepted Solution

by:
chensu earned 150 total points
ID: 1412439
Yes.

#import <mso97.dll> no_namespace rename("DocumentProperties", "DocumentPropertiesXL")  
#import <vbeext1.olb> no_namespace  
#import <excel8.olb> rename("DialogBox", "DialogBoxXL") rename("RGB", "RBGXL") rename("DocumentProperties", "DocumentPropertiesXL") no_dual_interfaces

There is a sample that comes with Visual C++ 5.0.

Visual C++ Samples\Compiler COM Support Samples\COMEXCEL: Demonstrates an Automation Client Application with Compiler COM Support
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Launching Internet Explorer inPrivate mode using VBA 14 623
Nest Related files not working in Visual Studio 4 83
Need example 5 137
What .NET website keeps me current? 9 80
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…

734 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