473,657 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automation error, cannot create ActiveX object on .net

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

moExcel = CreateObject("E xcel.Applicatio n")
moWorkBook = moExcel.Workboo ks.Add
moSheet = moWorkBook.Work sheets(liSheetN um)
moSheet.Delete( )
moSheet = moWorkBook.Work sheets(liSheetN um)
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 3239
* la****@yahoo.co m (Patrick) scripsit:
I have a middle tier object that generates Excel spreadsheet
here is the code

moExcel = CreateObject("E xcel.Applicatio n")
moWorkBook = moExcel.Workboo ks.Add
moSheet = moWorkBook.Work sheets(liSheetN um)
moSheet.Delete( )
moSheet = moWorkBook.Work sheets(liSheetN um)
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.c om> wrote in message
news:64******** *************** ***@posting.goo gle.com...
I have a middle tier object that generates Excel spreadsheet
here is the code

moExcel = CreateObject("E xcel.Applicatio n")
moWorkBook = moExcel.Workboo ks.Add
moSheet = moWorkBook.Work sheets(liSheetN um)
moSheet.Delete( )
moSheet = moWorkBook.Work sheets(liSheetN um)
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.co m (Patrick) wrote:

¤ I have a middle tier object that generates Excel spreadsheet
¤ here is the code
¤
¤ moExcel = CreateObject("E xcel.Applicatio n")
¤ moWorkBook = moExcel.Workboo ks.Add
¤ moSheet = moWorkBook.Work sheets(liSheetN um)
¤ moSheet.Delete( )
¤ moSheet = moWorkBook.Work sheets(liSheetN um)
¤ 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******@amerit ech.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
2745
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 and a public property which returns it. string options = new string; public string Options {
2
5565
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 create ActiveX component I set in the reference the COM from Outlook... Does someone know how to solve this problem????
3
6735
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 objOSSet = GetObject("winmgmts:{impersonationLevel=impersonate,(RemoteShutdown)}//" & strComp & "/root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
0
1238
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 create ActiveX component. at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName) at MediaBuilder.Utils.PDFCreator.PDFCreator.Main(String args) in C: \Visual Studio Projects\Utilities\PDFCreator\Main.cs:line 31
9
18187
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 various ways on the page. This has been working fine under Windows XP, but now we have a client who is wanting to move the client-side asp web page to the Windows 2003 server. They want for non-administrator users to be able to access their server over...
1
1414
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 solution ? thanx dhanis
1
5365
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 design view. Everything runs fine when I run the page, it's only design view that gives the error. My custom server web control is inherited form the wizard control. In OnInit I add a Child to the wizard, witch is also a custom server web
2
4070
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 returning the error "cannot create ActiveX component" and then the program crashes. Any help is much appreciated. Thank you. Larry
2
4037
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}!\\" & lcServerIP & "\root\cimv2") Same code crashes when I call it from Windows Service application doing the same thing. I run service under both Local System and my user name.
0
8402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8829
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7341
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.