Re: Error when using CreateObject in client side VBScript.
- From: "Dave Patrick" <DSPatrick@xxxxxxxxxxxxxxxx>
- Date: Sat, 8 Oct 2005 18:03:30 -0600
Try saving it as an HTA
--
Regards,
Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
"DJP" wrote:
| Hi there
|
| Apologies if this is not quite the correct group but I am having trouble
| trying to create various objects using the VBScript CreateObject function
| inside a client side HTML page. The following is the complete code of a
test
| page that I put together.
|
| '===============================================
| <html><head><title>Test CreateObject</title>
| <script language=VBScript>
| Dim objNetwork
|
| On Error Resume Next
| Err.Clear
| Set objNetwork = CreateObject("WScript.Network")
| If Err.Number <> 0 Then
| MsgBox Err.Description
| Else
| MsgBox objNetwork.UserDomain
| End If
|
| Set objNetwork = Nothing
|
| </script></head><body>
| This is a test
| </body></html>
| '===============================================
|
| Whenever I open this page, the CreateObject function errors and the
| displayed error message is "ActiveX component can't create object". I have
| tried creating various other ActiveX objects (eg Excel.Application) but
| still get the same error. I know that this code is the correct syntax etc
| because I have run it successfully in a VBS file (without the HTML
| obviously).
|
| I have tested the code on three machines with the following specs. All
| display the same error message.
| 1. WinXP, SP2, IE6.0.2900
| 2. WinXP, SP1, IE6.0.2800
| 3. Win2k, SP4, IE6.0.2800
|
| I've had a look at IE's security settings and found no problems there. Had
a
| look at the Local Security Policy but also found nothing. I've also had a
| bit of a poke around on the internet and couldn't find anything
significant
| that would indicate what the problem could be.
|
| If anyone could help me out on this, it will be greatly appreciated.
|
| Regards
| David
|
|
|
|
|
.
- Follow-Ups:
- References:
- Prev by Date: Error when using CreateObject in client side VBScript.
- Next by Date: Run method in ASP - app hidden....
- Previous by thread: Error when using CreateObject in client side VBScript.
- Next by thread: Re: Error when using CreateObject in client side VBScript.
- Index(es):
Relevant Pages
|