473,395 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Automation error, cannot create ActiveX object on .net

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
4 3222
* 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

"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Hessam | last post by:
Hello, I am designing a .net custom control in VS.net 7.1 and my control exposes an array of strings which are supposed to be the items to show. To do this have declared a private string variable...
2
by: W. Broersen | last post by:
I want to use Outlook.Application, but I donot get further. Dim objOLApp As Outlook.Application objOLApp = CreateObject("Outlook.Application") Everytime I'll get the following error: Cannot...
3
by: Amadej Bukorovic | last post by:
I've been trying to write a simple program to remotely reboot a computer but with little success. It stops with this part of the code: Sub RebootComputer(ByVal strComp) Dim objOSSet, objOS...
0
by: Verakso | last post by:
I have made a small interop function that uses Acrobat Distiller. It works smothly on all the XP machines, but when I try to run it on a Windows 2000,I get this error: System.Exception: Cannot...
9
by: Anyhoo | last post by:
Hello: We have an ActiveX DLL that we created in C++. We are calling it from vbscript at the top of an .asp page using the "CreateObject" command. The asp page interacts with the ActiveX DLL in...
1
by: dhanis | last post by:
am a .net programmer.. working in asp.net.. i got an error "cannot create activex component" while running web deployment project.But didnt get that error while running the code.. have any...
1
by: Allan Ebdrup | last post by:
I get the error: "Cannot create an object of type 'CustomWizard' from its string representation 'CustomWizard1' for the CustomWizard Property." when I view my custom server web control in...
2
by: ironmanlarry | last post by:
Hi, I'm trying to do a mail merge from Excel to Word (programatically) and I'm having some trouble creating the Word Document Object. This line of code wordDoc = GetObject("sheet.doc") keeps...
2
by: relasoft | last post by:
Hello guys, I have code that works fine in Windows Forms application: Dim objWMIService As Object objWMIService = GetObject("winmgmts: " _ & "{impersonationLevel=impersonate}!\\" &...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.