Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / September 2005

Tip: Looking for answers? Try searching our database.

C++ namespace for Excel application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bill - 26 Sep 2005 13:27 GMT
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
Carl Daniel [VC++ MVP] - 26 Sep 2005 15:13 GMT
> All,
>
[quoted text clipped - 3 lines]
>
>   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
bill - 28 Sep 2005 13:36 GMT
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
Carl Daniel [VC++ MVP] - 28 Sep 2005 14:33 GMT
> I am doing managed C++. I cannot seem to get the reference to the
> Excel "object". I have the following references:
[quoted text clipped - 7 lines]
> 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.