Re: Problems referencing Excel using C# - urgent!
From: Trilok Khairnar (trilok_khairnar_at_persistent.co.in)
Date: 05/07/04
- Next message: Trilok Khairnar: "Re: Automating Excel w/ C# - how to define a cell range using "1,1" format rather than "A1" format ???"
- Previous message: Idael Cardoso: "Re: incorrect string returned from a DLL function"
- In reply to: Peter Huang: "Re: Problems referencing Ms.office.interop classes (library 10.0) using C#"
- Next in thread: Matt C: "Re: Problems referencing Excel using C# - urgent!"
- Reply: Matt C: "Re: Problems referencing Excel using C# - urgent!"
- Reply: m_at_tt: "Re: Problems referencing Excel using C# - urgent!"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 7 May 2004 16:52:53 +0530
Hello Peter,
I have a similar problem.
I am trying to access MS Excel using automation from a c# class in my
ASP.Net web application. .Net framework version is 1.1
I can access Excel 2000 as 'using Excel' and my project has a reference to
Excel 9.0 library.
I cannot access Excel as "using Excel = Microsoft.Office.Interop.Excel;"
I am running Widows 2000 Pro SP4. Need I be concerned with the Microsoft
PIAs?
Or the PIAs are only for Windows XP?
I get an exception as soon as I instantiate an object of Excel.Application
or Excel.ApplicationClass().
The exception stack trace is as follows:
[COMException (0x80080005): Server execution failed]
Ypc.DSquare.Common.Pages.Wait.Page_Load(Object sender, EventArgs e) in
D:\DSquare\Phase1\Src\Web\Common\Pages\Wait.aspx.cs:92
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
In machine.config. The ASP.Net has attribute username = "SYSTEM" for the
processmodel tag.
Thanks in advance,
Trilok.
""Peter Huang"" <v-phuang@online.microsoft.com> wrote in message
news:6ko9jt$MEHA.308@cpmsftngxa10.phx.gbl...
> Hi Barry,
>
> A primary interop assembly is a unique, vendor-supplied assembly that
> contains type definitions (as metadata) of types implemented with COM.
> There can be only one primary interop assembly, which must be signed with
a
> strong name by the publisher of the COM type library. A single primary
> interop assembly can wrap more than one version of the same type library.
>
> For detailed information please refer to the link below.
> Primary Interop Assemblies
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
> l/cpconlocatingprimaryinteropassemblies.asp
>
>
> Also because the .net runtime will probe for the assembly in the GAC first
> and then the other path. That is to say, if the PIA is installed in the
> GAC, even if we have set the copylocal property to true, and a interop
> assembly will exist in the application's debug directory, but the .net
> runtime will still use the assembly in GAC.
> For detailed information about How the Runtime Locates Assemblies, please
> check the link below.
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
> l/cpconhowruntimelocatesassemblies.asp
>
> As your concern that the Word will not use the Assembly in the GAC, am I
> right?(you may check by check the path of the word assembly as I have said
> in my last post)
>
> I think it may be caused by that the word PIA is not installed properly,
> you may try to re-register the PIA.
> Please perform the installation steps again as described in the Office XP
> PIA Readme will most likely solve the problem. The Readme file is shipped
> with the office XP install package.
>
> You may try my suggestion and let me know the result.
>
> Best regards,
>
> Peter Huang
> Microsoft Online Partner Support
>
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
- Next message: Trilok Khairnar: "Re: Automating Excel w/ C# - how to define a cell range using "1,1" format rather than "A1" format ???"
- Previous message: Idael Cardoso: "Re: incorrect string returned from a DLL function"
- In reply to: Peter Huang: "Re: Problems referencing Ms.office.interop classes (library 10.0) using C#"
- Next in thread: Matt C: "Re: Problems referencing Excel using C# - urgent!"
- Reply: Matt C: "Re: Problems referencing Excel using C# - urgent!"
- Reply: m_at_tt: "Re: Problems referencing Excel using C# - urgent!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|