473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automate Excel from MFC and Visual C++ 2005 problems

3 New Member
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.microso ft.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.mic rosoft.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.mic rosoft.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:\\Progra m Files\\Microsof t Office\\Office1 2\\EXCEL.EXE" no_namespace" with the following three imports
"#import "C:\\Progra m Files\\Common Files\\Microsof t Shared\\OFFICE1 2\\mso.dll" rename("RGB", "MSRGB")"
"#import "C:\\Progra m Files\\Common Files\\Microsof t Shared\\VBA\\VB A6\\VBE6EXT.OLB " raw_interfaces_ only, rename("Referen ce", "ignorethis "), rename("VBE", "testVBE")"
"#import "C:\\Progra m Files\\Microsof t Office\\OFFICE1 2\\excel.exe" exclude("IFont" , "IPicture") rename("RGB", "ignorethis "), rename("DialogB ox", "ignorethis "), rename("VBE", "testVBE"), rename("Replace Text", "EReplaceText") , rename("CopyFil e","ECopyFile") , rename("FindTex t", "EFindText" ), rename("NoPromp t", "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 3464

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

Similar topics

16
48852
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 a commercial program such as Adobe Acrobat and its associated API. The technique uses Ghostscript and Redirection Port Monitor - two free...
7
5332
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 able to destroy instances of excel (with the exact same code). I have read many, many posts, and they seem to get bogged down in specifics. So I...
3
6715
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 xlapp = CreateObject("Excel.Application") and then I went off in debauchery like this:
2
4355
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
1449
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 of spreadsheets with macros that I would like to deliver to people via a web application(read only for now maye not in the future).... Some...
10
8185
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 everything I can find on COM Interop and .NET. I've also tried many of the 'Walkthroughs' on the MSDN site relating to COM add-ins, .NET and Office XP...
1
2380
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
11582
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 ...... The problem is Excel.Application is not recognized. I have the Excell
2
1502
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 in .NET? -- Alexander L. Wykel AW Software Works
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5719
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.