ian_khoo_sc
asked on
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.UnauthorizedAccessE xception: Access is denied. at Orders.GetDeliverySchedule .getfile() in c:\inetpub\wwwroot\Orders\ GetDeliver ySchedule. aspx.vb:li ne 44 at Orders.GetDeliverySchedule .Page_Load (Object sender, EventArgs e) in c:\inetpub\wwwroot\Orders\ GetDeliver ySchedule. aspx.vb:li ne 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?
I try to use Dim oExcel As New Excel.Application for my web application using VB.NET.
But it give me following error
System.UnauthorizedAccessE
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?
Do you have excel installed in your server? Also try using some alternate method to generate excel instead.
ASKER
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.
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.
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.
ASKER
Can you provide a simple example?
Thanks for your help
Thanks for your help
What are you exporting to excel ? a datagrid?
try searching EE you can get tons of examples.
one of them is here..
https://www.experts-exchange.com/questions/21587480/EXPORT-TO-EXCEL.html
try searching EE you can get tons of examples.
one of them is here..
https://www.experts-exchange.com/questions/21587480/EXPORT-TO-EXCEL.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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("Applica
Dim oSheet as Object
oSheet=oApp.Worksheets.Add
...