Object required: 'Wscript' 
Author Message
 Object required: 'Wscript'

I am very new to WSH, in fact just this afternoon new so I hope this make
sense.  I get the following error:

Microsoft VBScript runtime error '800a01a8'
Object required: 'Wscript'
/speech/speech.asp, line 50

When I try to run the  script below. I am running Win98 with MSPWS. I've
researched to the best of my knowledge but can't figure out what is going on
in line 50. It looks like I have WSH installed etc. I can use it from the
RUN command. I've included the script and indicated LINE 50. I was wondering
if there is something I should be doing to  run WHS on Win98
Thank you in advance.
Collin

Dim AgentControl
Set AgentControl = CreateObject("Agent.Control.1")
     If IsObject(AgentControl) Then
          AgentControl.Connected = True

Dim chPath
Dim ch

chPath = "C:\Windows\MSAgent\chars\merlin.acs"
ch = "merlin.acs"

     AgentControl.Characters.Load ch, chPath
     set ch = AgentControl.Characters (ch)
     ch.Get "state", "Showing"
     ch.Get "state", "Speaking"
     ch.MoveTo 10, 10
Dim FileName

'************************************************************
(THIS IS LINE 50) set WSHShell = Wscript.CreateObject("wscript.Shell")
On Error Resume Next
set objDlg = wscript.CreateObject("MSComDlg.CommonDialog")
  objDlg.Filter = "All Files (*.*)|*.*|Text Files (*.txt)|*.txt"
  objDlg.FilterIndex = 2
  objDlg.MaxFileSize = 260
  objDlg.CancelError = true
  objDlg.ShowOpen
  FileName = objDlg.FileName

ch.Show

'************************************************************

  Const ForReading = 1, ForWriting = 2, ForAppending = 3
  Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
  Dim fs, f, ts, s
  Set fs = CreateObject("Scripting.FileSystemObject")
  Set f = fs.GetFile(FileName)
  Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)

     Do While ts.AtEndOfStream <> True
          On Error Resume Next
          s = ts.ReadLine
          ch.Speak s

     Loop
          ts.Close

MsgBox "Don't click ok until Merlin is done reading",,"Don't Do it"

End If



Thu, 24 May 2001 03:00:00 GMT  
 Object required: 'Wscript'
Change line 50, to read:

  Set WSHShell = CreateObject("WScript.Shell")

Not:

  set WSHShell = Wscript.CreateObject("wscript.Shell")

See Ya


|I am very new to WSH, in fact just this afternoon new so I hope this make
|sense.  I get the following error:
|
|Microsoft VBScript runtime error '800a01a8'
|Object required: 'Wscript'
|/speech/speech.asp, line 50



Thu, 24 May 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Error: object required: 'WScript'

2. runtime error 800a01a8, Object Required: 'Application(...)'

3. Object required: 'f.Name'

4. Object Required: ''

5. Object required: 'server'

6. Object required: '[undefined]'

7. Error: require object 'server'

8. Object required '[string:'[object]']' error?

9. Now it's an object required error, you all are awesome

10. No WScript object in WSC's?

11. The WScript object I'm dreaming on

12. Can't Create Object WScript.Shell in Win 98 (1st Ed) and Win 95

 

 
Powered by phpBB® Forum Software