HighTechTalks DotNet Forums  

DCOM Issue with Excel

Dotnet Framework microsoft.public.dotnet.framework


Discuss DCOM Issue with Excel in the Dotnet Framework forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Michael Burgess
 
Posts: n/a

Default DCOM Issue with Excel - 10-19-2007 , 08:15 AM






Hi there,

When I try to get an instance of my Excel application in code I get an
UnauthorizedAccessException thrown with 'Access Is Denied'.

I've heard that DCOM needs permissioning to allow access, but I'm not
sure how. I've tried adding ASPNET into the security as a user with
the rights to do so, but no joy. The ASP.NET app in question has
anonymous access disabled - does that make any difference?

Any ideas? Not found anything that's worked for me yet on the net.

Cheers,
Michael.


Reply With Quote
  #2  
Old   
Scott M.
 
Posts: n/a

Default Re: DCOM Issue with Excel - 10-19-2007 , 08:59 AM






How are you trying to get your Excel instance. What makes you think you are
using DCOM?


"Michael Burgess" <michael.burgess (AT) rabobank (DOT) com> wrote

Quote:
Hi there,

When I try to get an instance of my Excel application in code I get an
UnauthorizedAccessException thrown with 'Access Is Denied'.

I've heard that DCOM needs permissioning to allow access, but I'm not
sure how. I've tried adding ASPNET into the security as a user with
the rights to do so, but no joy. The ASP.NET app in question has
anonymous access disabled - does that make any difference?

Any ideas? Not found anything that's worked for me yet on the net.

Cheers,
Michael.




Reply With Quote
  #3  
Old   
Michael Burgess
 
Posts: n/a

Default Re: DCOM Issue with Excel - 10-23-2007 , 05:21 AM



On 19 Oct, 13:59, "Scott M." <s-... (AT) nospam (DOT) nospam> wrote:
Quote:
How are you trying to get your Excel instance. What makes you think you are
using DCOM?

"Michael Burgess" <michael.burg... (AT) rabobank (DOT) com> wrote in message

news:1192796144.864215.40240 (AT) v29g2000prd (DOT) googlegroups.com...



Hi there,

When I try to get an instance of my Excel application in code I get an
UnauthorizedAccessException thrown with 'Access Is Denied'.

I've heard that DCOM needs permissioning to allow access, but I'm not
sure how. I've tried adding ASPNET into the security as a user with
the rights to do so, but no joy. The ASP.NET app in question has
anonymous access disabled - does that make any difference?

Any ideas? Not found anything that's worked for me yet on the net.

Cheers,
Michael.- Hide quoted text -

- Show quoted text -
This is the call that throws the exception..............

excelApp = new Microsoft.Office.Interop.Excel.Application();

Any ideas?

I'm not desperate to find out as it turns out the production problem
was a data error, but I'm sure I'll have to make changes soon and I'll
need my dev PC to work properly with the site.

Thanks,
Michael.



Reply With Quote
  #4  
Old   
Scott M.
 
Posts: n/a

Default Re: DCOM Issue with Excel - 10-23-2007 , 11:03 AM




"Michael Burgess" <michael.burgess (AT) rabobank (DOT) com> wrote

Quote:
On 19 Oct, 13:59, "Scott M." <s-... (AT) nospam (DOT) nospam> wrote:
How are you trying to get your Excel instance. What makes you think you
are
using DCOM?

"Michael Burgess" <michael.burg... (AT) rabobank (DOT) com> wrote in message

news:1192796144.864215.40240 (AT) v29g2000prd (DOT) googlegroups.com...



Hi there,

When I try to get an instance of my Excel application in code I get an
UnauthorizedAccessException thrown with 'Access Is Denied'.

I've heard that DCOM needs permissioning to allow access, but I'm not
sure how. I've tried adding ASPNET into the security as a user with
the rights to do so, but no joy. The ASP.NET app in question has
anonymous access disabled - does that make any difference?

Any ideas? Not found anything that's worked for me yet on the net.

Cheers,
Michael.- Hide quoted text -

- Show quoted text -

This is the call that throws the exception..............

excelApp = new Microsoft.Office.Interop.Excel.Application();

Any ideas?

I'm not desperate to find out as it turns out the production problem
was a data error, but I'm sure I'll have to make changes soon and I'll
need my dev PC to work properly with the site.

Thanks,
Michael.

I have a couple of thoughts on this. First, this is not DCOM at all. DCOM
has to do with utilizing an object across the LAN using MS proprietary
technology. This is InterOperability between a .NET assembly and a COM
component.

Microsoft recommends using the PIA's (Primary InterOp Assemblies when
connecting to Office libraries as these assemblies have been built
specifically for this purpose.

Here is a nice article describing the Office PIA's and it contains links to
their usage - perhaps it will help.

http://msdn2.microsoft.com/en-us/lib...hw(VS.80).aspx

Good luck.

-Scott





Reply With Quote
  #5  
Old   
Michael Burgess
 
Posts: n/a

Default Re: DCOM Issue with Excel - 10-23-2007 , 11:13 AM



On 23 Oct, 16:03, "Scott M." <s-... (AT) nospam (DOT) nospam> wrote:
Quote:
"Michael Burgess" <michael.burg... (AT) rabobank (DOT) com> wrote in message

news:1193131271.657271.282190 (AT) e9g2000prf (DOT) googlegroups.com...





On 19 Oct, 13:59, "Scott M." <s-... (AT) nospam (DOT) nospam> wrote:
How are you trying to get your Excel instance. What makes you think you
are
using DCOM?

"Michael Burgess" <michael.burg... (AT) rabobank (DOT) com> wrote in message

news:1192796144.864215.40240 (AT) v29g2000prd (DOT) googlegroups.com...

Hi there,

When I try to get an instance of my Excel application in code I get an
UnauthorizedAccessException thrown with 'Access Is Denied'.

I've heard that DCOM needs permissioning to allow access, but I'm not
sure how. I've tried adding ASPNET into the security as a user with
the rights to do so, but no joy. The ASP.NET app in question has
anonymous access disabled - does that make any difference?

Any ideas? Not found anything that's worked for me yet on the net.

Cheers,
Michael.- Hide quoted text -

- Show quoted text -

This is the call that throws the exception..............

excelApp = new Microsoft.Office.Interop.Excel.Application();

Any ideas?

I'm not desperate to find out as it turns out the production problem
was a data error, but I'm sure I'll have to make changes soon and I'll
need my dev PC to work properly with the site.

Thanks,
Michael.

I have a couple of thoughts on this. First, this is not DCOM at all. DCOM
has to do with utilizing an object across the LAN using MS proprietary
technology. This is InterOperability between a .NET assembly and a COM
component.

Microsoft recommends using the PIA's (Primary InterOp Assemblies when
connecting to Office libraries as these assemblies have been built
specifically for this purpose.

Here is a nice article describing the Office PIA's and it contains links to
their usage - perhaps it will help.

http://msdn2.microsoft.com/en-us/lib...hw(VS.80).aspx

Good luck.

-Scott- Hide quoted text -

- Show quoted text -
Thanks Scott, I'll take a look - have to admit I know nada about DCOM,
hence my naivety!



Reply With Quote
  #6  
Old   
Alvin Bruney [MVP]
 
Posts: n/a

Default Re: DCOM Issue with Excel - 10-26-2007 , 10:08 PM



A couple things can cause this chiefly that the Excel object isn't correctly
registered. It will usually throw a null reference object, but I have seen
it throw exceptions related to permissions access. Secondly, your ASP.NET
application runs least privilege meaning that your worker process trying
automate Excel may not have sufficient permission. You can determine which
of the two is the issue by turning CAS off at a command prompt (cas -s off)
and running the application. If it works, bump your worker process
permissions up a notch. If it still fails, go register the Excel object.

I don't suspect this is a PIA issue but it may be solved by installing the
PIAs again, which would point to registration issue.
--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless Author Plug
OWC Black Book 2nd Edition
Exclusively on www.lulu.com/owc
$24.99


"Michael Burgess" <michael.burgess (AT) rabobank (DOT) com> wrote

Quote:
On 23 Oct, 16:03, "Scott M." <s-... (AT) nospam (DOT) nospam> wrote:
"Michael Burgess" <michael.burg... (AT) rabobank (DOT) com> wrote in message

news:1193131271.657271.282190 (AT) e9g2000prf (DOT) googlegroups.com...





On 19 Oct, 13:59, "Scott M." <s-... (AT) nospam (DOT) nospam> wrote:
How are you trying to get your Excel instance. What makes you think
you
are
using DCOM?

"Michael Burgess" <michael.burg... (AT) rabobank (DOT) com> wrote in message

news:1192796144.864215.40240 (AT) v29g2000prd (DOT) googlegroups.com...

Hi there,

When I try to get an instance of my Excel application in code I get
an
UnauthorizedAccessException thrown with 'Access Is Denied'.

I've heard that DCOM needs permissioning to allow access, but I'm
not
sure how. I've tried adding ASPNET into the security as a user with
the rights to do so, but no joy. The ASP.NET app in question has
anonymous access disabled - does that make any difference?

Any ideas? Not found anything that's worked for me yet on the net.

Cheers,
Michael.- Hide quoted text -

- Show quoted text -

This is the call that throws the exception..............

excelApp = new Microsoft.Office.Interop.Excel.Application();

Any ideas?

I'm not desperate to find out as it turns out the production problem
was a data error, but I'm sure I'll have to make changes soon and I'll
need my dev PC to work properly with the site.

Thanks,
Michael.

I have a couple of thoughts on this. First, this is not DCOM at all.
DCOM
has to do with utilizing an object across the LAN using MS proprietary
technology. This is InterOperability between a .NET assembly and a COM
component.

Microsoft recommends using the PIA's (Primary InterOp Assemblies when
connecting to Office libraries as these assemblies have been built
specifically for this purpose.

Here is a nice article describing the Office PIA's and it contains links
to
their usage - perhaps it will help.

http://msdn2.microsoft.com/en-us/lib...hw(VS.80).aspx

Good luck.

-Scott- Hide quoted text -

- Show quoted text -

Thanks Scott, I'll take a look - have to admit I know nada about DCOM,
hence my naivety!




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.