I guess following articles will be helpful to you.
>X-Tomcat-ID: 634164860
>References: <IpW9geVxFHA.3020@TK2MSFTNGXA01.phx.gbl>
<#QObSncxFHA.1132@TK2MSFTNGP10.phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain
>Content-Transfer-Encoding: 7bit
>From: udayt@microsoft.com (Uday Takbhate [MSFT])
>Organization: Microsoft
>Date: Wed, 05 Oct 2005 20:44:36 GMT
>Subject: RE: Excel API from VC++ .NET
>X-Tomcat-NG: microsoft.public.dotnet.framework.interop
>Message-ID: <wNSTf2eyFHA.3032@TK2MSFTNGXA01.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.interop
>Lines: 76
>Path: TK2MSFTNGXA01.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.interop:10009
>NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
>
>Bill,
>
>Intellisense will not show anything in this case.
>
>I guess you are experiencing the following error in the WinMain() right?
>If yes then try something like..
>
>int APIENTRY _tWinMain(HINSTANCE hInstance,
> HINSTANCE hPrevInstance,
> LPTSTR lpCmdLine,
> int nCmdShow)
>{
> System::Threading::Thread::CurrentThread->ApartmentState =
>System::Threading::ApartmentState::STA;
> System::Windows::Forms::Application::Run(new Form1());
>
> ...............
>}
>
>Because in WinMain() the Run() method of Form is expected to be called not
>that of Excel::Application.
>
>If you are trying to invoke the Run method on Excel::Application then
refer
>to the following link for more information of this method.
>
http://msdn.microsoft.com/library/en-us/vbaac11/html/acmthRun_HV05186408.as p
>
>Run method is used to call a macro defined in the excel workbook from
using
>excel object model.
>
>There is very little documentation available on automation using C++ or
>VC++ as most of the MSDN documents assume automation using visual basic
>
>Regards,
>Uday Takbhate [MSFT]
>--------------------
>>From: Bill <wgrigg@draper.com>
>>References: <IpW9geVxFHA.3020@TK2MSFTNGXA01.phx.gbl>
>>X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
>>Subject: RE: Excel API from VC++ .NET
>>Mime-Version: 1.0
>>Content-Type: text/plain; charset="us-ascii"
>>Content-Transfer-Encoding: 7bit
>>Message-ID: <#QObSncxFHA.1132@TK2MSFTNGP10.phx.gbl>
>>Newsgroups: microsoft.public.dotnet.framework.interop
>>Date: Fri, 30 Sep 2005 07:18:24 -0700
>>NNTP-Posting-Host: 67.41.129.85
>>Lines: 1
>>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
>>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework.interop:9914
>>X-Tomcat-NG: microsoft.public.dotnet.framework.interop
>>
>>Uday,
>>
>>I think part of my problem was that I did not have a reference to the MS
>>Office com object. Anyway after adding that the following did compile:
>>
>>"using namespace Microsoft::Office::Interop::Excel;"
>>
>>This created a namespace conflict with the following:
>>
>>"using namespace System::Windows::Forms;"
>>
>>The form could not be declared because the "Application" part thought is
>>was an Excel application. Anyway, I solved that problem and now I do not
>>know how to delcare the Excel application. The following code:
>>
>> Microsoft::Office::Interop::Excel::Application* ap;
>>.....
>> Microsoft::Office::Interop::Excel::Application::Run(ap);
>>
>>produces the following error message:
>>
>>"error C2660: 'Microsoft::Office::Interop::Excel::_Application::Run' :
>>function does not take 1 arguments"
>>
>>
>>I cannot of course figure out what the call to run the Excel application
>>looks like because Intellisense shows nothing and there is no
>>documentation that I can find.
>>
>>Help,
>>
>>Bill
>>
>>
>>
>>--
>>Sent via .NET Newsgroups
>>
http://www.dotnetnewsgroups.com >>
>
>