473,848 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Applicati on" error.

<script language="vbscr ipt">
Sub TableToExcel_on click
Dim sHTML, oExcel, oBook
sHTML = document.all.it em("DataGrid1") .outerHTML
Set oExcel = CreateObject("E xcel.Applicatio n")
Set oBook = oExcel.Workbook s.Add
oBook.HTMLProje ct.HTMLProjectI tems("Sheet1"). Text = sHTML
oBook.HTMLProje ct.RefreshDocum ent
oExcel.Visible = true
oExcel.UserCont rol = true
End Sub
</script>

This script works when when I navigate to the .htm file via a c: drive
physical path:
c:\inetpub\wwwr oot\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.Applicat ion' )??

thanks,

-Steve

Nov 19 '05 #1
3 2965
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.Applicati on" error.

<script language="vbscr ipt">
Sub TableToExcel_on click
Dim sHTML, oExcel, oBook
sHTML = document.all.it em("DataGrid1") .outerHTML
Set oExcel = CreateObject("E xcel.Applicatio n")
Set oBook = oExcel.Workbook s.Add
oBook.HTMLProje ct.HTMLProjectI tems("Sheet1"). Text = sHTML
oBook.HTMLProje ct.RefreshDocum ent
oExcel.Visible = true
oExcel.UserCont rol = true
End Sub
</script>

This script works when when I navigate to the .htm file via a c: drive physical path:
c:\inetpub\wwwr oot\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.Applicat ion' )??
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******** *************@l 41g2000cwc.goog legroups.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.Applicati on" error.

<script language="vbscr ipt">
Sub TableToExcel_on click
Dim sHTML, oExcel, oBook
sHTML = document.all.it em("DataGrid1") .outerHTML
Set oExcel = CreateObject("E xcel.Applicatio n")
Set oBook = oExcel.Workbook s.Add
oBook.HTMLProje ct.HTMLProjectI tems("Sheet1"). Text = sHTML
oBook.HTMLProje ct.RefreshDocum ent
oExcel.Visible = true
oExcel.UserCont rol = true
End Sub
</script>

This script works when when I navigate to the .htm file via a c: drive physical path:
c:\inetpub\wwwr oot\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.Applicat ion' )??
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******** *************@l 41g2000cwc.goog legroups.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.Applicati on" error.

<script language="vbscr ipt">
Sub TableToExcel_on click
Dim sHTML, oExcel, oBook
sHTML = document.all.it em("DataGrid1") .outerHTML
Set oExcel = CreateObject("E xcel.Applicatio n")
Set oBook = oExcel.Workbook s.Add
oBook.HTMLProje ct.HTMLProjectI tems("Sheet1"). Text = sHTML
oBook.HTMLProje ct.RefreshDocum ent
oExcel.Visible = true
oExcel.UserCont rol = true
End Sub
</script>

This script works when when I navigate to the .htm file via a c: drive physical path:
c:\inetpub\wwwr oot\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.Applicat ion' )??
thanks,

-Steve

Nov 19 '05 #4

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

Similar topics

2
13416
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 template and by setting output to a type library (DLL). All the object does is return a string value. At this point I have not checked the option to register for COM interop in Visual Studio So I go into Excel (where I want to use the object). Go to VB...
2
5362
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 (Standard Exe) that calls and controls other modules (ActiveX-Exe). We decided for ActiveX-Exe because they run in different processes. That means if one module shuts down, the others are still alive. Second reasons
7
10004
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 used to post to a public folder. The component works fine when instantiated from a Windows script, but when using it from COM Interop in an ASP.NET web application it errors when trying to execute oNs.GetNameSpace("MAPI"). The error it throws...
1
3120
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 they all seem to say either nothing about this or that this is "out of the scope of this book", even "Professional ASP.NET". I have a ActiveX component that I'd like to expose through a .NET wrapper so in the case that a client browses to my...
6
9358
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 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
3
2526
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 control to pallete and then add a reference. I get the interop dll added to bin folder. I did this with the MediaPlayer activex control as a simple case to to try and get it working. I set the control to autostart via the html parameter tag for...
1
2500
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 this object I do not see the ActiveX component in the Applications list of the Task Manager. NOW, if I switch the Thread Model to Thread per Object or increase the Thread Pool to greater than 1, I see the ActiveX EXE in the Application list of the...
6
8086
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 .dll I can not call the functions in the ActiveX component. In the next step I tried to use the ActiveX component in a class library. I simply added a reference to the corresponding COM component. This this only
0
2499
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 advance.
0
9893
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
11001
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
10664
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...
1
10722
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10348
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5735
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
5919
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4137
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.