When running the following script:
VBSTART
Function Test
set fso = CreateObject( "scripting.FileSystemObject" )
if fso.FolderExists("c:\Windows") then
MsgBox("There is a folder name \Windows")
WScript.echo "There is a folder name \Windows"
end if
End Function
VBEND
VBEval>Test
Message>Ok
It always genrates Error 424: Object Required: 'WScript'.
Do I have to create an object instance for WScript in the Macro Scheduler script?
I'll be grateful for your help. Thanks.
VBscript.echo
Moderators: Dorian (MJT support), JRL
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Since the newer version of Macro Scheduler has VB scripting support included, we will probably be discussing more vb code issues.
Could I suggest that a separate Forum Category be set up to deal with them separately?
I know that at times, they will not be able to be separated, but think it would be better to make the effort.
Could I suggest that a separate Forum Category be set up to deal with them separately?
I know that at times, they will not be able to be separated, but think it would be better to make the effort.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
You will need to add the following line at the beginning of the VB script:
Dim fso As Object
Function Test()
Dim fso As Object
...
...
...
WScript probably also needs to be declared, but I am not sure what you are trying to do....The Echo Action can be used in Access to hide a macro, but that does not apply to Macro Scheduler macros.
If that line is left out, then the Message Box comes up OK after fso is declared.
Hope this helps....
Dim fso As Object
Function Test()
Dim fso As Object
...
...
...
WScript probably also needs to be declared, but I am not sure what you are trying to do....The Echo Action can be used in Access to hide a macro, but that does not apply to Macro Scheduler macros.
If that line is left out, then the Message Box comes up OK after fso is declared.
Hope this helps....
Hi Bob,
Thanks for your feedback. In actuality, it shouldn't casue too much problem to any Macro Scheduler script writer. Most VBScript bulit-in objects work perfectly in the Macro Scheduler script while WScript is the only notable exception. In the worst case, Macro Scheduler can EXE an external .vbs which includes the WScript methods and/or properties.
Again, thanks for your help. Happy New Year.
Thanks for your feedback. In actuality, it shouldn't casue too much problem to any Macro Scheduler script writer. Most VBScript bulit-in objects work perfectly in the Macro Scheduler script while WScript is the only notable exception. In the worst case, Macro Scheduler can EXE an external .vbs which includes the WScript methods and/or properties.
Again, thanks for your help. Happy New Year.