473,395 Members | 1,639 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.

grant IIS permission to create excel activex object

I am getting error in a vbscript:
ActiveX component cant create object: Excel.Application.

The vbscript code is:
Dim objExcel
Set objExcel = CreateObject("Excel.Application")

I am pretty sure it is a permission issue because the script works when
I point the browser directly at the .htm file on the c: drive:
c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm

What is the quickest, best way to grant the IIS user ( aspnet? )
permission to create the activex object in error?

thanks,
-Steve

Nov 19 '05 #1
6 9321
Hi Steve,

First of all, it's better not to use Office automation on
server-side. Microsoft does not currently recommend, and
does not support, Automation of Microsoft Office
applications on server-side.
(http://support.microsoft.com/default.aspx?scid=kb;EN-
US;q257757#kb2)

Secondly, if you still want to use it, please check out
following url:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dno2k3ta/html/odc_VBNETcallsVBA.asp
HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
I am getting error in a vbscript:
ActiveX component cant create object: Excel.Application.

The vbscript code is:
Dim objExcel
Set objExcel = CreateObject("Excel.Application")

I am pretty sure it is a permission issue because the script works whenI point the browser directly at the .htm file on the c: drive: c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm

What is the quickest, best way to grant the IIS user ( aspnet? )permission to create the activex object in error?

thanks,
-Steve

.

Nov 19 '05 #2

Elton Wang wrote:
Hi Steve,

First of all, it's better not to use Office automation on
server-side. Microsoft does not currently recommend, and
does not support, Automation of Microsoft Office
applications on server-side.
(http://support.microsoft.com/default.aspx?scid=kb;EN-
US;q257757#kb2)

Secondly, if you still want to use it, please check out
following url:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dno2k3ta/html/odc_VBNETcallsVBA.asp
HTH

Elton Wang
el********@hotmail.com
Hi Elton,

thanks for the reply. Yes, I have read those articles in the last few
days. The problem does not appear to be a permission issue because I
made ASPNET an administrator on my development system and the problem
remains.

Thinking about it, there should be no permission issues. I am not
using Excel on the server side. At least I dont think I am!

<script language="vbscript">
Sub exportbutton_onclick
Dim sHTML, oExcel, oBook
sHTML = document.all.item("DataGrid1").outerHTML
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML
oBook.HTMLProject.RefreshDocument
oExcel.Visible = true
oExcel.UserControl = true
End Sub
</script>

This is all client side scripting, right? So whatever permission is
required should be a function of the client side IE user.

My problem remains and I still dont understand. My demo .htm file,
that runs the above script to copy a rendered <TABLE> to an excel
spreadsheet, works when I navigate to the .htm file via a c: drive
physical path:
c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm

but it fails with the "ActiveX component cant create object:
Excel.Application" message when I navigate to it via:
http://localhost/demosite/VbScript1.htm

Why cant the ActiveX component create the object?

thanks,

-Steve

-----Original Message-----
I am getting error in a vbscript:
ActiveX component cant create object: Excel.Application.

The vbscript code is:
Dim objExcel
Set objExcel = CreateObject("Excel.Application")

I am pretty sure it is a permission issue because the

script works when
I point the browser directly at the .htm file on the c:

drive:
c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm

What is the quickest, best way to grant the IIS user (

aspnet? )
permission to create the activex object in error?

thanks,
-Steve

.


Nov 19 '05 #3
"Steve Richter" <St************@gmail.com> wrote in
news:11**********************@f14g2000cwb.googlegr oups.com:
thanks for the reply. Yes, I have read those articles in the last few
days. The problem does not appear to be a permission issue because I
made ASPNET an administrator on my development system and the problem
remains.


Have you tried going through the Office PIA instead?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #4

Lucas Tam wrote:
"Steve Richter" <St************@gmail.com> wrote in
news:11**********************@f14g2000cwb.googlegr oups.com:
thanks for the reply. Yes, I have read those articles in the last few days. The problem does not appear to be a permission issue because I made ASPNET an administrator on my development system and the problem remains.
Have you tried going through the Office PIA instead?


Lucas, just to show who you are dealing with, I had never heard of PIAs
before reading your post.

http://msdn.microsoft.com/library/en...asp?frame=true

It is fascinating what MS is doing with all its software, but right now
it is beyond my scope! I would just like this simple process of
exporting an HTML table to excel to work so I can demostrate it to my
users.

thanks,

-Steve
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/


Nov 19 '05 #5
Hi Steve,

If you want to run excel automation on client-side via web
page, it is even worse idea. Internet browser has security
limit of restricting to access client-side local
resources. The ASPNET account permission is only on server-
side. You can't set permission to access client-side
resources; otherwise it's very easy for someone to make
harmful code.

Anyway, it seems you just want to export datagrid to excel
file. There is a easier way to do it. You can use
datagrid's RenderControl methos to build a string to
StringWriter object (via HtmlTextWriter object), set
Response.ContentType as "application/vnd.ms-excel", and
use Response.write to output StringWriter's content.
(I can post the code. Each time I posted code of exporting
datagrid to excel, it showed very strange signs. It's easy
for you to search the code.)
HTH

Elton Wang

-----Original Message-----

Elton Wang wrote:
Hi Steve,

First of all, it's better not to use Office automation on server-side. Microsoft does not currently recommend, and
does not support, Automation of Microsoft Office
applications on server-side.
(http://support.microsoft.com/default.aspx?scid=kb;EN-
US;q257757#kb2)

Secondly, if you still want to use it, please check out
following url:
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dno2k3ta/html/odc_VBNETcallsVBA.asp
HTH

Elton Wang
el********@hotmail.com
Hi Elton,

thanks for the reply. Yes, I have read those articles in

the last fewdays. The problem does not appear to be a permission issue because Imade ASPNET an administrator on my development system and the problemremains.

Thinking about it, there should be no permission issues. I am notusing Excel on the server side. At least I dont think I am!
<script language="vbscript">
Sub exportbutton_onclick
Dim sHTML, oExcel, oBook
sHTML = document.all.item("DataGrid1").outerHTML
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
oBook.HTMLProject.HTMLProjectItems("Sheet1").Text = sHTML oBook.HTMLProject.RefreshDocument
oExcel.Visible = true
oExcel.UserControl = true
End Sub
</script>

This is all client side scripting, right? So whatever permission isrequired should be a function of the client side IE user.

My problem remains and I still dont understand. My demo .htm file,that runs the above script to copy a rendered <TABLE> to an excelspreadsheet, works when I navigate to the .htm file via a c: drivephysical path:
c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm

but it fails with the "ActiveX component cant create object:Excel.Application" message when I navigate to it via:
http://localhost/demosite/VbScript1.htm

Why cant the ActiveX component create the object?

thanks,

-Steve

>-----Original Message-----
>I am getting error in a vbscript:
> ActiveX component cant create object: Excel.Application. >
>The vbscript code is:
> Dim objExcel
> Set objExcel = CreateObject("Excel.Application")
>
>I am pretty sure it is a permission issue because the

script works when
>I point the browser directly at the .htm file on the c:

drive:
> c:\inetpub\wwwroot\DemoSite\VbScriptTest.htm
>
>What is the quickest, best way to grant the IIS user (

aspnet? )
>permission to create the activex object in error?
>
>thanks,
>-Steve
>
>.
>


.

Nov 19 '05 #6

Elton Wang wrote:
Hi Steve,

If you want to run excel automation on client-side via web
page, it is even worse idea. Internet browser has security
limit of restricting to access client-side local
resources. The ASPNET account permission is only on server-
side. You can't set permission to access client-side
resources; otherwise it's very easy for someone to make
harmful code.
makes sense. too bad though, it is very functional. And I would still
like to know why it does not work!

Anyway, it seems you just want to export datagrid to excel
file. There is a easier way to do it. You can use
datagrid's RenderControl methos to build a string to
StringWriter object (via HtmlTextWriter object), set
Response.ContentType as "application/vnd.ms-excel", and
use Response.write to output StringWriter's content.
(I can post the code. Each time I posted code of exporting
datagrid to excel, it showed very strange signs. It's easy
for you to search the code.)


I have tested that method and it looks like great functionality. Would
prefer that the excel application start in its own familiar window, but
that is ok.

I guess this method is the prefered, secure way of exporting web page
contents to a client side application. Curious how I can write my own
client side application that functions like excel does in this context.

thanks,

-Steve

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: brazilnut | last post by:
Hi. Let me explain the setup. I am using Visual Studio .NET to develop a sort of add-in (COM class) for Excel called SQLAddin. It basically queries a SQL server and pulls in data. Now within my...
2
by: brazilnut52 | last post by:
I am going to outline the steps I go through to produce the problem. Hopefully this will help you understand the problem better I have created a simple COM DLL in .NET by using the COM class...
4
by: Patrick | last post by:
I have a middle tier object that generates Excel spreadsheet here is the code moExcel = CreateObject("Excel.Application") moWorkBook = moExcel.Workbooks.Add moSheet =...
4
by: Mark | last post by:
I was able to get procedure to work in a VB.Net Windows application, and want to get it to work within a ASP.Net page. It won't create the instance of Excel. It blows up on the CreateObject...
5
by: Michael Fuhr | last post by:
I'd like to propose that certain GRANTs on a table cascade to the table's implicit sequences. In the current implementation (as of 7.4.5 and 8.0.0beta3), a table owner must typically issue GRANT...
4
by: Abdhul Saleem | last post by:
Hi, I am recieving error ActiveX component can't create object in the following line in the asp page. set ExcelApp = CreateObject("Excel.Application") Previously this code was working fine....
3
by: Administrator | last post by:
Hi, My web development server is a Windows 2000 SP4 system. Had created an aspx page with the following code which I had extracted from 1 of the Microsoft websites: Dim oExcel As Object Dim...
4
by: Steve Kershaw | last post by:
Hi, I have a simple web page that starts Excel and fills it with some dummy data. Using IE I can run this web page from the C: drive (IE: "C: \startexcel.htm") and it runs fine. However, when I...
2
by: stjones1 | last post by:
My company has implementd Vista with IE7 and office 2007. We also use Sharepoint extensively for team sites and division portals. I am in Sharepoint consultation/support. One user just moved a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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...
0
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...
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...

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.