Solved

Excel automation controller

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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