Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel automation controller

Posted on 1998-03-31
1
Medium Priority
?
388 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 600 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

782 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