Solved

Excel automation controller

Posted on 1998-03-31
1
379 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
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 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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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