By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,723 Members | 842 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,723 IT Pros & Developers. It's quick & easy.

Automation error, cannot create ActiveX object on .net

P: n/a
I have a middle tier object that generates Excel spreadsheet
here is the code

moExcel = CreateObject("Excel.Application")
moWorkBook = moExcel.Workbooks.Add
moSheet = moWorkBook.Worksheets(liSheetNum)
moSheet.Delete()
moSheet = moWorkBook.Worksheets(liSheetNum)
moSheet.Delete()

We can this middle tier object from the web application, it runs fine
on my development box, but it gave me "Cannot create ActiveX
component." error when I depoly it to the server.

I wrote a simple win app that calls the same codes and tried to run
the win exe on the server box, and it gave me no error.

I think this has to do with security since the win exe is running
under the context of my login (admin) but the web application runs
under aspnet_wp account.

Please help!

Thanks!
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
* la****@yahoo.com (Patrick) scripsit:
I have a middle tier object that generates Excel spreadsheet
here is the code

moExcel = CreateObject("Excel.Application")
moWorkBook = moExcel.Workbooks.Add
moSheet = moWorkBook.Worksheets(liSheetNum)
moSheet.Delete()
moSheet = moWorkBook.Worksheets(liSheetNum)
moSheet.Delete()

We can this middle tier object from the web application, it runs fine
on my development box, but it gave me "Cannot create ActiveX
component." error when I depoly it to the server.

I wrote a simple win app that calls the same codes and tried to run
the win exe on the server box, and it gave me no error.

I think this has to do with security since the win exe is running
under the context of my login (admin) but the web application runs
under aspnet_wp account.


Is Excel installed on the server?

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a

"Patrick" <la****@yahoo.com> wrote in message
news:64**************************@posting.google.c om...
I have a middle tier object that generates Excel spreadsheet
here is the code

moExcel = CreateObject("Excel.Application")
moWorkBook = moExcel.Workbooks.Add
moSheet = moWorkBook.Worksheets(liSheetNum)
moSheet.Delete()
moSheet = moWorkBook.Worksheets(liSheetNum)
moSheet.Delete()

We can this middle tier object from the web application, it runs fine
on my development box, but it gave me "Cannot create ActiveX
component." error when I depoly it to the server.

I wrote a simple win app that calls the same codes and tried to run
the win exe on the server box, and it gave me no error.

I think this has to do with security since the win exe is running
under the context of my login (admin) but the web application runs
under aspnet_wp account.
So do I. Why dont you then change your permissions to give that account the permission to create
the excel objects, or change your code to run as a different user, that does have permissions.
Please help!

Thanks!

Nov 20 '05 #3

P: n/a
On 28 Oct 2003 10:14:17 -0800, la****@yahoo.com (Patrick) wrote:

I have a middle tier object that generates Excel spreadsheet
here is the code

moExcel = CreateObject("Excel.Application")
moWorkBook = moExcel.Workbooks.Add
moSheet = moWorkBook.Worksheets(liSheetNum)
moSheet.Delete()
moSheet = moWorkBook.Worksheets(liSheetNum)
moSheet.Delete()

We can this middle tier object from the web application, it runs fine
on my development box, but it gave me "Cannot create ActiveX
component." error when I depoly it to the server.

I wrote a simple win app that calls the same codes and tried to run
the win exe on the server box, and it gave me no error.

I think this has to do with security since the win exe is running
under the context of my login (admin) but the web application runs
under aspnet_wp account.


See if the following articles help. They weren't written with ASP.NET in mind but you should be able
to apply the same logic:

INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/default...b;EN-US;257757

HOWTO: Configure Office Applications to Run Under a Specific User Account
http://support.microsoft.com/default...b;en-us;288367

HOWTO: Configure Office Applications to Run Under the Interactive User Account
http://support.microsoft.com/default...b;en-us;288366
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #4

P: n/a
Thanks for the articles and it helped!

I got it working now, all i have to do is go to Dcom config, select
Microsfot Excel Application, grant permission to launch to "everyone"

Thanks for the help!
Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.