473,396 Members | 1,918 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,396 software developers and data experts.

ActiveX component cant create object

running a simple vbscript in an .htm page that starts excel and loads
the spreadsheet with the contents of a <table> ... </table>

getting an "Error: ActiveX component cant create object.
Excel.Application" error.

<script language="vbscript">
Sub TableToExcel_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 script works when when I navigate to the .htm file via a c: drive
physical path:
c:\inetpub\wwwroot\DemoSite\Vb*ScriptTest.htm

but it fails with the above described message when I navigate to it
via:
http://localhost/demosite/VbSc*ript1.htm

I dont think it is a permission issue because I gave ASPNET, the IIS
user on my system, administrator rights, just to rule that possiblity
out.

any ideas why my script fails to CreateObject( 'Excel.Application' )??

thanks,

-Steve

Nov 19 '05 #1
3 2941
the reason for this error is a security setting in IE:
- tools, internet options, security
- activex controls and plugins
- "initialize and script activex controls not marked as safe"
- in my IE, this option was set to "disable"

any idea how excel or any other activex control can be marked as safe?

-Steve
Steve Richter wrote:
running a simple vbscript in an .htm page that starts excel and loads
the spreadsheet with the contents of a <table> ... </table>

getting an "Error: ActiveX component cant create object.
Excel.Application" error.

<script language="vbscript">
Sub TableToExcel_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 script works when when I navigate to the .htm file via a c: drive physical path:
c:\inetpub\wwwroot\DemoSite\Vb*ScriptTest.htm

but it fails with the above described message when I navigate to it
via:
http://localhost/demosite/VbSc*ript1.htm

I dont think it is a permission issue because I gave ASPNET, the IIS
user on my system, administrator rights, just to rule that possiblity
out.

any ideas why my script fails to CreateObject( 'Excel.Application' )??
thanks,

-Steve


Nov 19 '05 #2
that can not be marked safe, because they aren't. you will need to convince
your users to trust your site. in IE they can add your site to trusted site
and raise permission level. the other is to have them download the hta to a
local disk. the local disk is usually trusted (though not on my machine).

-- bruce (sqlwork.com)

"Steve Richter" <St************@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
the reason for this error is a security setting in IE:
- tools, internet options, security
- activex controls and plugins
- "initialize and script activex controls not marked as safe"
- in my IE, this option was set to "disable"

any idea how excel or any other activex control can be marked as safe?

-Steve
Steve Richter wrote:
running a simple vbscript in an .htm page that starts excel and loads
the spreadsheet with the contents of a <table> ... </table>

getting an "Error: ActiveX component cant create object.
Excel.Application" error.

<script language="vbscript">
Sub TableToExcel_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 script works when when I navigate to the .htm file via a c: drive physical path:
c:\inetpub\wwwroot\DemoSite\Vb*ScriptTest.htm

but it fails with the above described message when I navigate to it
via:
http://localhost/demosite/VbSc*ript1.htm

I dont think it is a permission issue because I gave ASPNET, the IIS
user on my system, administrator rights, just to rule that possiblity
out.

any ideas why my script fails to CreateObject( 'Excel.Application' )??
thanks,

-Steve

Nov 19 '05 #3
that can not be marked safe, because they aren't. you will need to convince
your users to trust your site. in IE they can add your site to trusted site
and raise permission level. the other is to have them download the hta to a
local disk. the local disk is usually trusted (though not on my machine).

-- bruce (sqlwork.com)

"Steve Richter" <St************@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
the reason for this error is a security setting in IE:
- tools, internet options, security
- activex controls and plugins
- "initialize and script activex controls not marked as safe"
- in my IE, this option was set to "disable"

any idea how excel or any other activex control can be marked as safe?

-Steve
Steve Richter wrote:
running a simple vbscript in an .htm page that starts excel and loads
the spreadsheet with the contents of a <table> ... </table>

getting an "Error: ActiveX component cant create object.
Excel.Application" error.

<script language="vbscript">
Sub TableToExcel_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 script works when when I navigate to the .htm file via a c: drive physical path:
c:\inetpub\wwwroot\DemoSite\Vb*ScriptTest.htm

but it fails with the above described message when I navigate to it
via:
http://localhost/demosite/VbSc*ript1.htm

I dont think it is a permission issue because I gave ASPNET, the IIS
user on my system, administrator rights, just to rule that possiblity
out.

any ideas why my script fails to CreateObject( 'Excel.Application' )??
thanks,

-Steve

Nov 19 '05 #4

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

Similar topics

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...
2
by: Berata | last post by:
Hello all, in VB6 we were able to create ActiveX-DLL's (In Process Components) and ActiveX-Exe's (Out of Process Components). We habe build up an application that exists of an main module...
7
by: Munsifali Rashid | last post by:
Hi, I've built a webservice in C# that can add public folders to Exchange. There's also a component built in VB6 which references the Outlook 10 (XP) DLL, so I can change the default form being...
1
by: Mehr H | last post by:
I have been working on this for several days and am still have had no success in achieving this. Pleae help. It seems that documentation for this is very limited. I have looked in several books and...
6
by: Steve Richter | last post by:
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...
3
by: Jeffery Franzen | last post by:
Anyone know where the documentation is regarding Activex controls in asp web forms? I'm using VS.NET 2002 enterprise and am trying to use Activex controls in vb.net web form app. I do the add...
1
by: nkoranda | last post by:
I have been running into an issue that I just cant figure out. I have created an ActiveX EXE and in the Project Properties I have the Thread Model set to Thread Pool = 1. If I create an instance of...
6
by: hufaunder | last post by:
I have an ActiveX component that I want to use in a library that I am writing. As a first test I used the ActiveX component in a windows form application. Adding the component created: Ax.dll...
0
by: coolminded | last post by:
Dear all, when i run the following code it shows the error run-time error:'429' ActiveX Component cant create object i have also registered vbxmlrpc.dll what might the problem? thanx in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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...

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.