473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Automate Excel from MFC and Visual C++ 2005 problems

Hello!
I try to build (using Visual 2005 and Excel 2007) the example described in the Microsoft Help and Support "How to automate Excel from MFC and Visual C++ 2005 or Visual C++ .NET to fill or obtain data in a range using arrays" (URL: http://support.microsoft.com/kb/308407),
and I run into same problem as described in the MSDN Forums "Newbie Q regarding MFC automation client app" (http://forums.msdn.microsoft.com/en-US/vcgeneral/thread/9ae455c1-76fc-40ff-8f8f-d0682597d6a6/)

For solving it as described in the MSDN Forums "using excel type library in vc++2005" (http://forums.msdn.microsoft.com/en-US/vcgeneral/thread/1de6c74f-6cf0-4d91-a5a9-e85853b867f6/) ) I replaced the '#import' command in the 'CApplication.h', 'CRange.h', 'CWorkbook.h', 'CWorksheet.h', 'CWorkbooks.h', 'CWorksheets.h' headers file create by the 'MFC Add Class Wizard' (class wrappers from the type library)
"#import "C:\\Program Files\\Microsoft Office\\Office12\\EXCEL.EXE" no_namespace" with the following three imports
"#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\mso.dll" rename("RGB", "MSRGB")"
"#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB" raw_interfaces_only, rename("Reference", "ignorethis"), rename("VBE", "testVBE")"
"#import "C:\\Program Files\\Microsoft Office\\OFFICE12\\excel.exe" exclude("IFont", "IPicture") rename("RGB", "ignorethis"), rename("DialogBox", "ignorethis"), rename("VBE", "testVBE"), rename("ReplaceText", "EReplaceText"), rename("CopyFile","ECopyFile"), rename("FindText", "EFindText"), rename("NoPrompt", "ENoPrompt")"

but now the compiler doesn't recognized ("error C4430: missing type specifier") to the types 'Application', 'XlCreator', 'Border , 'Interior', 'ChartFormat' locate in the 'CRange.h', 'CWorkbook.h', 'CWorksheet.h', 'CWorkbooks.h', 'CWorksheets.h' headers file!


Can anybody tell me what I do wrong?
Sep 1 '08 #1
0 3448

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
7
by: taylor.bryant | last post by:
I am running: Win XP SP2 Excel 2002, Access 2002 (Office XP SP3) Using Visual Basic (not VB.NET) At one point (prior to XP SP2?!? - I can't pin it down), this did not happen and I was easily...
3
by: deko | last post by:
So I've decided to convert from Early Binding to Late Binding. Now that I've been baptized, I need some instruction in the faith. My former ways were thus: Dim xlapp As Excel.Application Set...
2
by: jcm | last post by:
I am trying to Automate Office with C#. How can I freeze panes in excel with Microsoft Visual C#? I hope someone can help me with this. Please help !
3
by: jeremy.bird | last post by:
I am looking for a possible solution or bump in the right direction when working with excel on the web. Currently I am using and developing in visual studio 2005. Here is the situation I have a lot...
10
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied...
1
by: Stephen Plotnick | last post by:
Where can I find all the excel commands available for VB 2005. I need the ones for Excel 2007. Thanks, Steve
4
by: Looch | last post by:
Thanks in advance for any help. I'm having trouble with this code: Dim xlsApp As Excel.Application Dim xlsWB As Excel.Workbook xlsApp = New Excel.Application xlsApp.Visible = True ...... ...
2
by: =?Utf-8?B?QWxleGFuZGVyIFd5a2Vs?= | last post by:
Is it possible to automate a COM object ebmeded in an excel document run the process and return the results in a C# .NET application? Or better yet extract the com object some how and just run it...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.