473,473 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C++ namespace for Excel application

All,

I cannot find any examples of doing Excel automation from a VC++ .Net
environment. Does anyone ay least know what the namespace should be to
expose the Excel app? i.e.

using namespace System::?????????????????

TIA,

Bill

Nov 17 '05 #1
3 2419
bill wrote:
All,

I cannot find any examples of doing Excel automation from a VC++ .Net
environment. Does anyone ay least know what the namespace should be to
expose the Excel app? i.e.

using namespace System::?????????????????


Are you doing managed C++ or native (aka unmanaged) C++?

For managed, you use the same manage PIAs (Primary Interop Assemblies) and
namespaces as you would for C# or VB.NET.

For unmanaged, you program Excell through it's OLE Automation (aka COM)
interface. Your best bet to get started is to look up the #import compiler
directive, and then try

#import "progid:Excel.Sheet"

The #import directive will create C++ wrappers that allow you to call the
OLE interfaces as comfortably as you could from VB6. The declarations will
be (by default) placed in a namespace with the same name as the library.

IIRC, you may also need to #import one or more common MS Office type
libraries (e.g. MSGraph.Application) in order to have full access to the
Excel API.

-cd
Nov 17 '05 #2
I am doing managed C++. I cannot seem to get the reference to the Excel
"object". I have the following references:

Excel
Microsoft.Office.Core

I cannot seem to figure out how to declare an Excel app from C++. I
also notice that intellisense works with all the references except for
Excel. Any pointers to examples that you can share. I have been
googling around in my spare time but cannot find anything useful (so
far).

TIA,

Bill

Nov 17 '05 #3
bill wrote:
I am doing managed C++. I cannot seem to get the reference to the
Excel "object". I have the following references:

Excel
Microsoft.Office.Core

I cannot seem to figure out how to declare an Excel app from C++. I
also notice that intellisense works with all the references except for
Excel. Any pointers to examples that you can share. I have been
googling around in my spare time but cannot find anything useful (so
far).


I have no experience controlling Excel from managed C++ (or any managed
language, for that matter). You might try posting in

microsoft.public.dotnet.framework.interop

and/or the VSTO group where you probably have a better chance of finding
someone that's been down your particular road before.

-cd
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rolf Kemper | last post by:
Dear Experts, I'm going to create an Excell spreadsheet xml. So far things work very well. But in case I add <Row> elements by a recursive template call it goes wrong. See the attached XSLT...
3
by: Otie | last post by:
I found the following under the GetObject help notes and in the example for GetObject: "This example uses the GetObject function to get a reference to a specific Microsoft Excel worksheet...
4
by: Krishna Tulasi via .NET 247 | last post by:
Hi, I am having trouble with creation of XML programmatically using .NET. Specifically Im trying to create an element which looks like below and insert into an existing xml doc: <Worksheet...
6
by: Matthew Wieder | last post by:
I have the following requirements: Build a stand-alone C# application that asks the user to click in a cell in an Excel spreadsheet, and then displays the address of that cell in the C#...
22
by: Howard Kaikow | last post by:
There's a significant problem in automating Excel from VB .NET. Reminds me of a problem I encountered almost 3 years ago that was caused by the Norton Auntie Virus Office plug-in. Can anybody...
2
by: Rich | last post by:
Greetings, I am trying to find a way to use a form of GetObject in VB.Net and have been researching WMI. Apparently, this is a vast subject, but seems to reference a Namespace called...
9
by: Anthony | last post by:
To me, creating Excel 2003 spreadsheets programmatically via VB.NET hasn't really changed since the days of VB6. That is, I'd do something similar to this Code: Dim ExcelApp As...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
0
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,...
0
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...
0
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,...
0
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...
0
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...
1
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...
0
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...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.