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

grant IIS permission to create excel activex object

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a

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

P: n/a
"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

P: n/a

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

P: n/a
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

P: n/a

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 discussion thread is closed

Replies have been disabled for this discussion.