Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Services (http://www.velocityreviews.com/forums/f64-asp-net-web-services.html)
-   -   How can I call ActiveX (e.g. Excel) from ASP.NET? (http://www.velocityreviews.com/forums/t784210-how-can-i-call-activex-e-g-excel-from-asp-net.html)

dfaherty 12-09-2004 10:49 PM

How can I call ActiveX (e.g. Excel) from ASP.NET?
 
I have a 3rd party application that has an ActiveX interface. For argument,
lets say that it is Excel.

I want a user to make a request (through the web browser), have the request
be processed by the server where Excel is installed (and the .xls exists),
and return some information. The server side should open an Excel
spreadsheet, do some calculations, and then return something to the user.

I am able to make these ActiveX calls in a VB.NET Windows Application.

However, when I create a ASP.NET Web application, I get a run time error
(usually "Object variable or with block not set").

I have been over the web and at Microsoft's pages for the last three weeks,
and I have not found anything that says I can't do it. See
http://msdn.microsoft.com/library/de...allcomcomp.asp
for a description of how to do it from a windows application.

I tried creating a web service which would process the requests on the
server. I cannot get it to make ActiveX calls (compiles OK, get runtime
errors). Am I using the wrong tool (ASP.NET)? Is it a permissions thing? I
found an article that uses DCOMCNFG.EXE to explicity give the ASPNET user
launch rights for Excel. Of course, this 3rd party application does not
appear in the list of Component Services.

I have set the browser security to the lowest to allow ActiveX to run, but
that didn't help either. I have Microsoft Developer Environment 2002.

Thanks!
Dennis


Dennis Faherty 12-10-2004 08:39 PM

RE: How can I call ActiveX (e.g. Excel) from ASP.NET?
 
The problem is with permissions for the ASPNET user.

You will often get the error
Procedure call or argument is not valid.

To access COM and ActiveX automation on the server side from the web, the
ASPNET user must have permissions to launch the COM object. For Excel,
configure this with DCOMCNFG.EXE (see
http://www.asp101.com/articles/jayra...et/default.asp for a good
example with code.)

To use a 3rd party DLL, you must give explicit permissions to the ASPNET
user (or use impersonation).
See http://bdn.borland.com/article/0,1410,26048,00.html for a related problem.

Basically, use OLEVIEW.EXE, locate the DLL you want to enable in the
Automation Objects list, and

add ASPNET to the launch permissions and access permissions tabs.




All times are GMT. The time now is 07:22 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.