Web application calling Excel 2003

G

Gilbert Tordeur

Hello,

My Web application in VB2008 with IIS calls Excel (2003) to create an Excel
file xls. I use therefore Microsoft.Office.Interop.Excel, version 11.
This application does not use anonymous connections; it automaticaly uses
the Windows userid.

On my development PC, with local server, everything is OK.

On a test server with IIS and Excel, my program gets an error on the first
statement related to Excel :
Dim ApplicationExcel As New Excel.Application

Error message: Retrieving the COM class factory for component with CLSID
{...} failed due to the following error : 80070005.
Explanations : ASP.NET is not authorized to access the requested resource.
Etc.

What access rights should I grant to what resources ?

Thank you for your help,
Gilbert
 
Z

ZSvedic

Hello,

My Web application in VB2008 with IIS calls Excel (2003) to create an Excel
file xls. I use therefore Microsoft.Office.Interop.Excel, version 11.
This application does not use anonymous connections; it automaticaly uses
the Windows userid.

On my development PC, with local server, everything is OK.

On a test server with IIS and Excel, my program gets an error on the first
statement related to Excel :
Dim ApplicationExcel As New Excel.Application

Error message: Retrieving the COM class factory for component with CLSID
{...} failed due to the following error : 80070005.
Explanations : ASP.NET is not authorized to access the requested resource..
Etc.

What access rights should I grant to what resources ?

Thank you for your help,
Gilbert

Hi,

Two things:
1) You need to have exactly the same version of Excel installed on
your web server.
2) Try using ASP.NET Full Trust mode. Office interop DLLs are
unmanaged code.

My opinion is that you should avoid COM interop
(http://www.gemboxsoftware.com/GBSpreadsheet.htm#Automation),
especially on a web server.

Our GemBox.Spreadsheet Free Excel component
(http://www.gemboxsoftware.com/GBSpreadsheetFree.htm) can be used
free
of charge to generate/import/export excel data as long as XLS/CSV/
XLSX
files are not large.

-- Zeljko
 
G

Gilbert Tordeur

ZSvedic,

Thank you for your answer.

1) Yes I use the same version on both machines.

2) I have granted full access to C:\ and D:\ to the account ASPNET, and I
have also changed the DCOM configuration (cf.
http://blog.crowe.co.nz/archive/2006/03/02/589.aspx), and now it works.

However I have probably given too many rights to ASP.NET ; do you know what
folders I have to give full access to ?

I will investigate the GemBox software.

Regards,
Gilbert

"ZSvedic" <[email protected]> a écrit dans le message de (e-mail address removed)...
Hello,

My Web application in VB2008 with IIS calls Excel (2003) to create an
Excel
file xls. I use therefore Microsoft.Office.Interop.Excel, version 11.
This application does not use anonymous connections; it automaticaly uses
the Windows userid.

On my development PC, with local server, everything is OK.

On a test server with IIS and Excel, my program gets an error on the first
statement related to Excel :
Dim ApplicationExcel As New Excel.Application

Error message: Retrieving the COM class factory for component with CLSID
{...} failed due to the following error : 80070005.
Explanations : ASP.NET is not authorized to access the requested resource.
Etc.

What access rights should I grant to what resources ?

Thank you for your help,
Gilbert

Hi,

Two things:
1) You need to have exactly the same version of Excel installed on
your web server.
2) Try using ASP.NET Full Trust mode. Office interop DLLs are
unmanaged code.

My opinion is that you should avoid COM interop
(http://www.gemboxsoftware.com/GBSpreadsheet.htm#Automation),
especially on a web server.

Our GemBox.Spreadsheet Free Excel component
(http://www.gemboxsoftware.com/GBSpreadsheetFree.htm) can be used
free
of charge to generate/import/export excel data as long as XLS/CSV/
XLSX
files are not large.

-- Zeljko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top