Unable to use Excel.Application

Hi All,

I try to use Dim oExcel As New Excel.Application for my web application using VB.NET.
But it give me following error
System.UnauthorizedAccessException: Access is denied. at Orders.GetDeliverySchedule.getfile() in c:\inetpub\wwwroot\Orders\GetDeliverySchedule.aspx.vb:line 44 at Orders.GetDeliverySchedule.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\Orders\GetDeliverySchedule.aspx.vb:line 36

I had Imports Excel library into my program reference.

The OS running on my server which is using for deployment is Window Server 2003. Then it willl give me the error msg above.
But if i use my development PC which running on Win XP. Then i will be able to run and generate the excel file without any error.

Can anyone advice, what should i do?
ian_khoo_scAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
vjc2003Connect With a Mentor Commented:
Do you have administrator rights on the machine?.
To Launch Excel Application you need to set the permissions in DCOM Config of the machine.
By default only administrator have the right to launch/activate..
Go to Administrative Tools>Component Services>DCOM Config and see security properties for MS Excel

If you are running this as a webapp you'll need to grant permission to the Internet Guest Account as well.
0
 
vb_jonasCommented:
You will need MS Excel to be installed and runnable on the computer where the app runs.

If it is a problem with different versions of Excel, I would suggest you to use late binding instead, (and remove the reference to Excel).

Dim oApp as Object
oApp=CreateObject("Application.Excel")

Dim oSheet as Object
oSheet=oApp.Worksheets.Add

...
0
 
navalarya1982Commented:
Do you have excel installed in your server? Also try using some alternate method to generate excel instead.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ian_khoo_scAuthor Commented:
Yes. I had installed excel into my server.
I had try 2 version of excel. First time i install in excel 97.
But it still not working.
Then i add in Excel 2002.

0
 
navalarya1982Commented:
I guess it not realated to excel version but with permission for you to run some other process. Here excel is other process which you are trying to use in ur web app. Why dont u try to go with method to export to excel without using. I think you can get tons of them easily.
0
 
ian_khoo_scAuthor Commented:
Can you provide a simple example?
Thanks for your help
0
 
navalarya1982Commented:
What are you exporting to excel ? a datagrid?

try searching EE you can get tons of examples.

one of them is here..

http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_21587480.html
0
All Courses

From novice to tech pro — start learning today.