Hi everyone

I've used the Visual Basic Editor in Word and Excel 2003 and have decided to
delve into VBS. I've managed to copy script samples from various sites,
paste them into Notepad and save the file with a .vbs extension. Needless
to say, the samples do what they're supposed to but, if I modify the code to
do something slightly different, it either works or it doesn't. If it
doesn't, an error messagebox is displayed which gives an idication of where
the error is.

I wonder if there's any software available to allow me to step through the
VBS and identify exactly what's happening as it runs, just as I can with the
VB editors in Word and Excel. I don't know if there's anything on my laptop
already (XP Pro SP2) or if I'd need third party software. Whilst experts
here are just that, I'd find it hard to believe that they can just generate
a perfect piece of complicated code out of thin air or debug it, almost as
if it's running in their heads!

Thanks for your time and patience.

Re: Writing and debugging VBS by Bob

Bob
Sun Oct 09 07:42:45 CDT 2005

Tosca wrote:
> Hi everyone
>
> I've used the Visual Basic Editor in Word and Excel 2003 and have
> decided to delve into VBS. I've managed to copy script samples from
> various sites, paste them into Notepad and save the file with a .vbs
> extension. Needless to say, the samples do what they're supposed to
> but, if I modify the code to do something slightly different, it
> either works or it doesn't. If it doesn't, an error messagebox is
> displayed which gives an idication of where the error is.
>
> I wonder if there's any software available to allow me to step
> through the VBS and identify exactly what's happening as it runs,
> just as I can with the VB editors in Word and Excel. I don't know if
> there's anything on my laptop already (XP Pro SP2) or if I'd need
> third party software. Whilst experts here are just that, I'd find it
> hard to believe that they can just generate a perfect piece of
> complicated code out of thin air or debug it, almost as if it's
> running in their heads!
> Thanks for your time and patience.

Google is your friend (if you use it <grin>):
http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: Writing and debugging VBS by Tosca

Tosca
Sun Oct 09 08:00:25 CDT 2005

Thank you Bob for the rapid reply. The first hit is the Microsoft Script
Debugger so it looks like I need that one. There's no indication about how
to get hold of a copy so I'll do some research. There's no suggestion that
it's on my PC already.

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
> Tosca wrote:
>> Hi everyone
>>
>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>> decided to delve into VBS. I've managed to copy script samples from
>> various sites, paste them into Notepad and save the file with a .vbs
>> extension. Needless to say, the samples do what they're supposed to
>> but, if I modify the code to do something slightly different, it
>> either works or it doesn't. If it doesn't, an error messagebox is
>> displayed which gives an idication of where the error is.
>>
>> I wonder if there's any software available to allow me to step
>> through the VBS and identify exactly what's happening as it runs,
>> just as I can with the VB editors in Word and Excel. I don't know if
>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>> third party software. Whilst experts here are just that, I'd find it
>> hard to believe that they can just generate a perfect piece of
>> complicated code out of thin air or debug it, almost as if it's
>> running in their heads!
>> Thanks for your time and patience.
>
> Google is your friend (if you use it <grin>):
> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>



Re: Writing and debugging VBS by Bob

Bob
Sun Oct 09 08:16:43 CDT 2005

Tosca wrote:
> Thank you Bob for the rapid reply. The first hit is the Microsoft
> Script Debugger so it looks like I need that one. There's no
> indication about how to get hold of a copy so I'll do some research.
> There's no suggestion that it's on my PC already.
>
It's on this page:
http://msdn.microsoft.com/library/shared/deeptree/asp/deeptree.asp?stcfg=/library/searchtabconfig.xml&dtcfg=/library/deeptreeconfig.xml&url=/downloads/list/webdev.asp?frame=true

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Re: Writing and debugging VBS by Jim

Jim
Sun Oct 09 08:27:20 CDT 2005

Tosca,

In Word or Excel have you tried...
Tools | Macro | Microsoft Script Editor ?
(Alt + Shift + F11)

Jim Cone
San Francisco, USA


"Tosca" <no-spam@thank-you.com> wrote in message
news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl
Thank you Bob for the rapid reply. The first hit is the Microsoft Script
Debugger so it looks like I need that one. There's no indication about how
to get hold of a copy so I'll do some research. There's no suggestion that
it's on my PC already.

"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
> Tosca wrote:
>> Hi everyone
>>
>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>> decided to delve into VBS. I've managed to copy script samples from
>> various sites, paste them into Notepad and save the file with a .vbs
>> extension. Needless to say, the samples do what they're supposed to
>> but, if I modify the code to do something slightly different, it
>> either works or it doesn't. If it doesn't, an error messagebox is
>> displayed which gives an idication of where the error is.
>>
>> I wonder if there's any software available to allow me to step
>> through the VBS and identify exactly what's happening as it runs,
>> just as I can with the VB editors in Word and Excel. I don't know if
>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>> third party software. Whilst experts here are just that, I'd find it
>> hard to believe that they can just generate a perfect piece of
>> complicated code out of thin air or debug it, almost as if it's
>> running in their heads!
>> Thanks for your time and patience.
>
> Google is your friend (if you use it <grin>):
> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>



Re: Writing and debugging VBS by MikeB

MikeB
Sun Oct 09 09:26:01 CDT 2005

Also,
It is quite common to simply plunk you vbscript code into a code module in
the VBA editor of any Office App and prototype it there before launching it in
the pure scripting environ.


"Tosca" <no-spam@thank-you.com> wrote in message
news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
> Thank you Bob for the rapid reply. The first hit is the Microsoft Script
> Debugger so it looks like I need that one. There's no indication about how
> to get hold of a copy so I'll do some research. There's no suggestion that
> it's on my PC already.
>
> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
> news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
>> Tosca wrote:
>>> Hi everyone
>>>
>>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>>> decided to delve into VBS. I've managed to copy script samples from
>>> various sites, paste them into Notepad and save the file with a .vbs
>>> extension. Needless to say, the samples do what they're supposed to
>>> but, if I modify the code to do something slightly different, it
>>> either works or it doesn't. If it doesn't, an error messagebox is
>>> displayed which gives an idication of where the error is.
>>>
>>> I wonder if there's any software available to allow me to step
>>> through the VBS and identify exactly what's happening as it runs,
>>> just as I can with the VB editors in Word and Excel. I don't know if
>>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>>> third party software. Whilst experts here are just that, I'd find it
>>> hard to believe that they can just generate a perfect piece of
>>> complicated code out of thin air or debug it, almost as if it's
>>> running in their heads!
>>> Thanks for your time and patience.
>>
>> Google is your friend (if you use it <grin>):
>> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>>
>> --
>> Microsoft MVP - ASP/ASP.NET
>> Please reply to the newsgroup. This email account is my spam trap so I
>> don't check it very often. If you must reply off-line, then remove the
>> "NO SPAM"
>>
>
>



Re: Writing and debugging VBS by Tosca

Tosca
Sun Oct 09 11:57:02 CDT 2005

Oh, I see. I was only aware of the VBA Editor (Alt + F11) in Word or Excel
2003. I had no idea about the other editor using Alt + Shift + F11. I'll
investigate this one to see how I can edit/debug my code there.

Many thanks

"MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
news:%23$D5g1NzFHA.3588@tk2msftngp13.phx.gbl...
> Also,
> It is quite common to simply plunk you vbscript code into a code module
> in the VBA editor of any Office App and prototype it there before
> launching it in the pure scripting environ.
>
>
> "Tosca" <no-spam@thank-you.com> wrote in message
> news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
>> Thank you Bob for the rapid reply. The first hit is the Microsoft Script
>> Debugger so it looks like I need that one. There's no indication about
>> how to get hold of a copy so I'll do some research. There's no
>> suggestion that it's on my PC already.
>>
>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>> news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
>>> Tosca wrote:
>>>> Hi everyone
>>>>
>>>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>>>> decided to delve into VBS. I've managed to copy script samples from
>>>> various sites, paste them into Notepad and save the file with a .vbs
>>>> extension. Needless to say, the samples do what they're supposed to
>>>> but, if I modify the code to do something slightly different, it
>>>> either works or it doesn't. If it doesn't, an error messagebox is
>>>> displayed which gives an idication of where the error is.
>>>>
>>>> I wonder if there's any software available to allow me to step
>>>> through the VBS and identify exactly what's happening as it runs,
>>>> just as I can with the VB editors in Word and Excel. I don't know if
>>>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>>>> third party software. Whilst experts here are just that, I'd find it
>>>> hard to believe that they can just generate a perfect piece of
>>>> complicated code out of thin air or debug it, almost as if it's
>>>> running in their heads!
>>>> Thanks for your time and patience.
>>>
>>> Google is your friend (if you use it <grin>):
>>> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>>>
>>> --
>>> Microsoft MVP - ASP/ASP.NET
>>> Please reply to the newsgroup. This email account is my spam trap so I
>>> don't check it very often. If you must reply off-line, then remove the
>>> "NO SPAM"
>>>
>>
>>
>
>



Re: Writing and debugging VBS by Tosca

Tosca
Sun Oct 09 13:51:35 CDT 2005

I'm going to need a bit more guidance!

I have a short .vbs file that works fine. I tried to copy and paste it into
the VBE in Word or Excel 2003 to step through it, but that drew a blank.

I did some googling and found out about MSE7.exe which is on my laptop (XP
Pro SP2). I ran it and then File>Open>"name of vbs file". The vbs file
opened in Design Mode, so I thought that I'd cracked it! I tried Debug>Step
Into (or F11), just as I have used "Step Into" in the VBA Editor in Excel or
Word, in the hope that the editor would step through the code for me. If it
had, I'd be able to edit the code, or create new code, to modify my project.
I was able to run the code (with F5) and the screen changed for a few
seconds, before reverting to the design mode. I have tried this with
breakpoints set and disabled, but that didn't make any difference. Although
the code seems to run, it doesn't produce any of the message boxes that it
should, or wait for user interaction.

What am I doing wrong? I've looked at the locals window but it says that I
cannot evaluate an expression whilst in design mode. I suspect that I need
to be out of design mode but have no idea how to do that. I've not been
able to find anything in the help facility. How do I use this editor (in a
similar way to the VBA editor) to step through my VBS code?

Thanks again for your patience!



"MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
news:%23$D5g1NzFHA.3588@tk2msftngp13.phx.gbl...
> Also,
> It is quite common to simply plunk you vbscript code into a code module
> in the VBA editor of any Office App and prototype it there before
> launching it in the pure scripting environ.
>
>
> "Tosca" <no-spam@thank-you.com> wrote in message
> news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
>> Thank you Bob for the rapid reply. The first hit is the Microsoft Script
>> Debugger so it looks like I need that one. There's no indication about
>> how to get hold of a copy so I'll do some research. There's no
>> suggestion that it's on my PC already.
>>
>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>> news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
>>> Tosca wrote:
>>>> Hi everyone
>>>>
>>>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>>>> decided to delve into VBS. I've managed to copy script samples from
>>>> various sites, paste them into Notepad and save the file with a .vbs
>>>> extension. Needless to say, the samples do what they're supposed to
>>>> but, if I modify the code to do something slightly different, it
>>>> either works or it doesn't. If it doesn't, an error messagebox is
>>>> displayed which gives an idication of where the error is.
>>>>
>>>> I wonder if there's any software available to allow me to step
>>>> through the VBS and identify exactly what's happening as it runs,
>>>> just as I can with the VB editors in Word and Excel. I don't know if
>>>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>>>> third party software. Whilst experts here are just that, I'd find it
>>>> hard to believe that they can just generate a perfect piece of
>>>> complicated code out of thin air or debug it, almost as if it's
>>>> running in their heads!
>>>> Thanks for your time and patience.
>>>
>>> Google is your friend (if you use it <grin>):
>>> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>>>
>>> --
>>> Microsoft MVP - ASP/ASP.NET
>>> Please reply to the newsgroup. This email account is my spam trap so I
>>> don't check it very often. If you must reply off-line, then remove the
>>> "NO SPAM"
>>>
>>
>>
>
>



Re: Writing and debugging VBS by DJP

DJP
Sun Oct 09 17:57:37 CDT 2005


Have you got an "on error resume next" somewhere near the top of your code?
If so, rem that out temporarily then re-run your script and see what
happens.

"Tosca" <no-spam@thank-you.com> wrote in message
news:eyqo6JQzFHA.3124@TK2MSFTNGP12.phx.gbl...
> I'm going to need a bit more guidance!
>
> I have a short .vbs file that works fine. I tried to copy and paste it
> into the VBE in Word or Excel 2003 to step through it, but that drew a
> blank.
>
> I did some googling and found out about MSE7.exe which is on my laptop (XP
> Pro SP2). I ran it and then File>Open>"name of vbs file". The vbs file
> opened in Design Mode, so I thought that I'd cracked it! I tried
> Debug>Step Into (or F11), just as I have used "Step Into" in the VBA
> Editor in Excel or Word, in the hope that the editor would step through
> the code for me. If it had, I'd be able to edit the code, or create new
> code, to modify my project. I was able to run the code (with F5) and the
> screen changed for a few seconds, before reverting to the design mode. I
> have tried this with breakpoints set and disabled, but that didn't make
> any difference. Although the code seems to run, it doesn't produce any of
> the message boxes that it should, or wait for user interaction.
>
> What am I doing wrong? I've looked at the locals window but it says that
> I cannot evaluate an expression whilst in design mode. I suspect that I
> need to be out of design mode but have no idea how to do that. I've not
> been able to find anything in the help facility. How do I use this editor
> (in a similar way to the VBA editor) to step through my VBS code?
>
> Thanks again for your patience!
>
>
>
> "MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
> news:%23$D5g1NzFHA.3588@tk2msftngp13.phx.gbl...
>> Also,
>> It is quite common to simply plunk you vbscript code into a code module
>> in the VBA editor of any Office App and prototype it there before
>> launching it in the pure scripting environ.
>>
>>
>> "Tosca" <no-spam@thank-you.com> wrote in message
>> news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
>>> Thank you Bob for the rapid reply. The first hit is the Microsoft
>>> Script Debugger so it looks like I need that one. There's no indication
>>> about how to get hold of a copy so I'll do some research. There's no
>>> suggestion that it's on my PC already.
>>>
>>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>>> news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
>>>> Tosca wrote:
>>>>> Hi everyone
>>>>>
>>>>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>>>>> decided to delve into VBS. I've managed to copy script samples from
>>>>> various sites, paste them into Notepad and save the file with a .vbs
>>>>> extension. Needless to say, the samples do what they're supposed to
>>>>> but, if I modify the code to do something slightly different, it
>>>>> either works or it doesn't. If it doesn't, an error messagebox is
>>>>> displayed which gives an idication of where the error is.
>>>>>
>>>>> I wonder if there's any software available to allow me to step
>>>>> through the VBS and identify exactly what's happening as it runs,
>>>>> just as I can with the VB editors in Word and Excel. I don't know if
>>>>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>>>>> third party software. Whilst experts here are just that, I'd find it
>>>>> hard to believe that they can just generate a perfect piece of
>>>>> complicated code out of thin air or debug it, almost as if it's
>>>>> running in their heads!
>>>>> Thanks for your time and patience.
>>>>
>>>> Google is your friend (if you use it <grin>):
>>>> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>>>>
>>>> --
>>>> Microsoft MVP - ASP/ASP.NET
>>>> Please reply to the newsgroup. This email account is my spam trap so I
>>>> don't check it very often. If you must reply off-line, then remove the
>>>> "NO SPAM"
>>>>
>>>
>>>
>>
>>
>
>



Re: Writing and debugging VBS by Tosca

Tosca
Mon Oct 10 02:00:20 CDT 2005

No - I don't have that line in the code. I've done a considerable amount of
googling but haven't found any explicit instructions about how to use this
editor!

Any other ideas? I've tried repairing the "Tools" within MS Office from the
installation disc but that's not helped. Similarly, I've run a full AV
scan, just in case the editor isn't working correctly because of viral
infection. It showed no infection!

"DJP" <djp@snotmail.com> wrote in message
news:Bfh2f.12283$U51.7859@news-server.bigpond.net.au...
>
> Have you got an "on error resume next" somewhere near the top of your
> code? If so, rem that out temporarily then re-run your script and see what
> happens.
>
> "Tosca" <no-spam@thank-you.com> wrote in message
> news:eyqo6JQzFHA.3124@TK2MSFTNGP12.phx.gbl...
>> I'm going to need a bit more guidance!
>>
>> I have a short .vbs file that works fine. I tried to copy and paste it
>> into the VBE in Word or Excel 2003 to step through it, but that drew a
>> blank.
>>
>> I did some googling and found out about MSE7.exe which is on my laptop
>> (XP Pro SP2). I ran it and then File>Open>"name of vbs file". The vbs
>> file opened in Design Mode, so I thought that I'd cracked it! I tried
>> Debug>Step Into (or F11), just as I have used "Step Into" in the VBA
>> Editor in Excel or Word, in the hope that the editor would step through
>> the code for me. If it had, I'd be able to edit the code, or create new
>> code, to modify my project. I was able to run the code (with F5) and the
>> screen changed for a few seconds, before reverting to the design mode. I
>> have tried this with breakpoints set and disabled, but that didn't make
>> any difference. Although the code seems to run, it doesn't produce any
>> of the message boxes that it should, or wait for user interaction.
>>
>> What am I doing wrong? I've looked at the locals window but it says that
>> I cannot evaluate an expression whilst in design mode. I suspect that I
>> need to be out of design mode but have no idea how to do that. I've not
>> been able to find anything in the help facility. How do I use this
>> editor (in a similar way to the VBA editor) to step through my VBS code?
>>
>> Thanks again for your patience!
>>
>>
>>
>> "MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
>> news:%23$D5g1NzFHA.3588@tk2msftngp13.phx.gbl...
>>> Also,
>>> It is quite common to simply plunk you vbscript code into a code
>>> module in the VBA editor of any Office App and prototype it there before
>>> launching it in the pure scripting environ.
>>>
>>>
>>> "Tosca" <no-spam@thank-you.com> wrote in message
>>> news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
>>>> Thank you Bob for the rapid reply. The first hit is the Microsoft
>>>> Script Debugger so it looks like I need that one. There's no
>>>> indication about how to get hold of a copy so I'll do some research.
>>>> There's no suggestion that it's on my PC already.
>>>>
>>>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>>>> news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
>>>>> Tosca wrote:
>>>>>> Hi everyone
>>>>>>
>>>>>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>>>>>> decided to delve into VBS. I've managed to copy script samples from
>>>>>> various sites, paste them into Notepad and save the file with a .vbs
>>>>>> extension. Needless to say, the samples do what they're supposed to
>>>>>> but, if I modify the code to do something slightly different, it
>>>>>> either works or it doesn't. If it doesn't, an error messagebox is
>>>>>> displayed which gives an idication of where the error is.
>>>>>>
>>>>>> I wonder if there's any software available to allow me to step
>>>>>> through the VBS and identify exactly what's happening as it runs,
>>>>>> just as I can with the VB editors in Word and Excel. I don't know if
>>>>>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>>>>>> third party software. Whilst experts here are just that, I'd find it
>>>>>> hard to believe that they can just generate a perfect piece of
>>>>>> complicated code out of thin air or debug it, almost as if it's
>>>>>> running in their heads!
>>>>>> Thanks for your time and patience.
>>>>>
>>>>> Google is your friend (if you use it <grin>):
>>>>> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>>>>>
>>>>> --
>>>>> Microsoft MVP - ASP/ASP.NET
>>>>> Please reply to the newsgroup. This email account is my spam trap so I
>>>>> don't check it very often. If you must reply off-line, then remove the
>>>>> "NO SPAM"
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Writing and debugging VBS by MikeB

MikeB
Mon Oct 10 10:00:14 CDT 2005

1. open a command prompt to the directory of your vbscript file

2 Enter the following command syntax:
wscript //x TheNameOfMyScript.vbs

This will determine if a debugger is working on your machine or not.

It will start whatever debugger is available and enabled. If it starts, the
distinguishable difference in operation, is you must set breakpoints inside of
functions if you wish to step through line by line...




"Tosca" <no-spam@thank-you.com> wrote in message
news:%231YKKhWzFHA.2064@TK2MSFTNGP09.phx.gbl...
> No - I don't have that line in the code. I've done a considerable amount of
> googling but haven't found any explicit instructions about how to use this
> editor!
>
> Any other ideas? I've tried repairing the "Tools" within MS Office from the
> installation disc but that's not helped. Similarly, I've run a full AV scan,
> just in case the editor isn't working correctly because of viral infection.
> It showed no infection!
>
> "DJP" <djp@snotmail.com> wrote in message
> news:Bfh2f.12283$U51.7859@news-server.bigpond.net.au...
>>
>> Have you got an "on error resume next" somewhere near the top of your code?
>> If so, rem that out temporarily then re-run your script and see what
>> happens.
>>
>> "Tosca" <no-spam@thank-you.com> wrote in message
>> news:eyqo6JQzFHA.3124@TK2MSFTNGP12.phx.gbl...
>>> I'm going to need a bit more guidance!
>>>
>>> I have a short .vbs file that works fine. I tried to copy and paste it
>>> into the VBE in Word or Excel 2003 to step through it, but that drew a
>>> blank.
>>>
>>> I did some googling and found out about MSE7.exe which is on my laptop (XP
>>> Pro SP2). I ran it and then File>Open>"name of vbs file". The vbs file
>>> opened in Design Mode, so I thought that I'd cracked it! I tried
>>> Debug>Step Into (or F11), just as I have used "Step Into" in the VBA Editor
>>> in Excel or Word, in the hope that the editor would step through the code
>>> for me. If it had, I'd be able to edit the code, or create new code, to
>>> modify my project. I was able to run the code (with F5) and the screen
>>> changed for a few seconds, before reverting to the design mode. I have
>>> tried this with breakpoints set and disabled, but that didn't make any
>>> difference. Although the code seems to run, it doesn't produce any of the
>>> message boxes that it should, or wait for user interaction.
>>>
>>> What am I doing wrong? I've looked at the locals window but it says that I
>>> cannot evaluate an expression whilst in design mode. I suspect that I need
>>> to be out of design mode but have no idea how to do that. I've not been
>>> able to find anything in the help facility. How do I use this editor (in a
>>> similar way to the VBA editor) to step through my VBS code?
>>>
>>> Thanks again for your patience!
>>>
>>>
>>>
>>> "MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
>>> news:%23$D5g1NzFHA.3588@tk2msftngp13.phx.gbl...
>>>> Also,
>>>> It is quite common to simply plunk you vbscript code into a code module
>>>> in the VBA editor of any Office App and prototype it there before
>>>> launching it in the pure scripting environ.
>>>>
>>>>
>>>> "Tosca" <no-spam@thank-you.com> wrote in message
>>>> news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
>>>>> Thank you Bob for the rapid reply. The first hit is the Microsoft Script
>>>>> Debugger so it looks like I need that one. There's no indication about
>>>>> how to get hold of a copy so I'll do some research. There's no suggestion
>>>>> that it's on my PC already.
>>>>>
>>>>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>>>>> news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
>>>>>> Tosca wrote:
>>>>>>> Hi everyone
>>>>>>>
>>>>>>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>>>>>>> decided to delve into VBS. I've managed to copy script samples from
>>>>>>> various sites, paste them into Notepad and save the file with a .vbs
>>>>>>> extension. Needless to say, the samples do what they're supposed to
>>>>>>> but, if I modify the code to do something slightly different, it
>>>>>>> either works or it doesn't. If it doesn't, an error messagebox is
>>>>>>> displayed which gives an idication of where the error is.
>>>>>>>
>>>>>>> I wonder if there's any software available to allow me to step
>>>>>>> through the VBS and identify exactly what's happening as it runs,
>>>>>>> just as I can with the VB editors in Word and Excel. I don't know if
>>>>>>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>>>>>>> third party software. Whilst experts here are just that, I'd find it
>>>>>>> hard to believe that they can just generate a perfect piece of
>>>>>>> complicated code out of thin air or debug it, almost as if it's
>>>>>>> running in their heads!
>>>>>>> Thanks for your time and patience.
>>>>>>
>>>>>> Google is your friend (if you use it <grin>):
>>>>>> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>>>>>>
>>>>>> --
>>>>>> Microsoft MVP - ASP/ASP.NET
>>>>>> Please reply to the newsgroup. This email account is my spam trap so I
>>>>>> don't check it very often. If you must reply off-line, then remove the
>>>>>> "NO SPAM"
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Writing and debugging VBS by Tosca

Tosca
Mon Oct 10 10:22:37 CDT 2005

Thank you - at last I can step through the code! The editor isn't quite as
sophisticated as the VBA editor in Word or Excel 2003 as I can write code in
there and it gives an indication of the syntax to be used. I guess VBS
isn't so easy after all!

"MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
news:u4tmTtazFHA.3408@TK2MSFTNGP09.phx.gbl...
> 1. open a command prompt to the directory of your vbscript file
>
> 2 Enter the following command syntax:
> wscript //x TheNameOfMyScript.vbs
>
> This will determine if a debugger is working on your machine or not.
>
> It will start whatever debugger is available and enabled. If it starts,
> the distinguishable difference in operation, is you must set breakpoints
> inside of functions if you wish to step through line by line...
>
>
>
>
> "Tosca" <no-spam@thank-you.com> wrote in message
> news:%231YKKhWzFHA.2064@TK2MSFTNGP09.phx.gbl...
>> No - I don't have that line in the code. I've done a considerable amount
>> of googling but haven't found any explicit instructions about how to use
>> this editor!
>>
>> Any other ideas? I've tried repairing the "Tools" within MS Office from
>> the installation disc but that's not helped. Similarly, I've run a full
>> AV scan, just in case the editor isn't working correctly because of viral
>> infection. It showed no infection!
>>
>> "DJP" <djp@snotmail.com> wrote in message
>> news:Bfh2f.12283$U51.7859@news-server.bigpond.net.au...
>>>
>>> Have you got an "on error resume next" somewhere near the top of your
>>> code? If so, rem that out temporarily then re-run your script and see
>>> what happens.
>>>
>>> "Tosca" <no-spam@thank-you.com> wrote in message
>>> news:eyqo6JQzFHA.3124@TK2MSFTNGP12.phx.gbl...
>>>> I'm going to need a bit more guidance!
>>>>
>>>> I have a short .vbs file that works fine. I tried to copy and paste it
>>>> into the VBE in Word or Excel 2003 to step through it, but that drew a
>>>> blank.
>>>>
>>>> I did some googling and found out about MSE7.exe which is on my laptop
>>>> (XP Pro SP2). I ran it and then File>Open>"name of vbs file". The vbs
>>>> file opened in Design Mode, so I thought that I'd cracked it! I tried
>>>> Debug>Step Into (or F11), just as I have used "Step Into" in the VBA
>>>> Editor in Excel or Word, in the hope that the editor would step through
>>>> the code for me. If it had, I'd be able to edit the code, or create
>>>> new code, to modify my project. I was able to run the code (with F5)
>>>> and the screen changed for a few seconds, before reverting to the
>>>> design mode. I have tried this with breakpoints set and disabled, but
>>>> that didn't make any difference. Although the code seems to run, it
>>>> doesn't produce any of the message boxes that it should, or wait for
>>>> user interaction.
>>>>
>>>> What am I doing wrong? I've looked at the locals window but it says
>>>> that I cannot evaluate an expression whilst in design mode. I suspect
>>>> that I need to be out of design mode but have no idea how to do that.
>>>> I've not been able to find anything in the help facility. How do I use
>>>> this editor (in a similar way to the VBA editor) to step through my VBS
>>>> code?
>>>>
>>>> Thanks again for your patience!
>>>>
>>>>
>>>>
>>>> "MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
>>>> news:%23$D5g1NzFHA.3588@tk2msftngp13.phx.gbl...
>>>>> Also,
>>>>> It is quite common to simply plunk you vbscript code into a code
>>>>> module in the VBA editor of any Office App and prototype it there
>>>>> before launching it in the pure scripting environ.
>>>>>
>>>>>
>>>>> "Tosca" <no-spam@thank-you.com> wrote in message
>>>>> news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
>>>>>> Thank you Bob for the rapid reply. The first hit is the Microsoft
>>>>>> Script Debugger so it looks like I need that one. There's no
>>>>>> indication about how to get hold of a copy so I'll do some research.
>>>>>> There's no suggestion that it's on my PC already.
>>>>>>
>>>>>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>>>>>> news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
>>>>>>> Tosca wrote:
>>>>>>>> Hi everyone
>>>>>>>>
>>>>>>>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>>>>>>>> decided to delve into VBS. I've managed to copy script samples
>>>>>>>> from
>>>>>>>> various sites, paste them into Notepad and save the file with a
>>>>>>>> .vbs
>>>>>>>> extension. Needless to say, the samples do what they're supposed
>>>>>>>> to
>>>>>>>> but, if I modify the code to do something slightly different, it
>>>>>>>> either works or it doesn't. If it doesn't, an error messagebox is
>>>>>>>> displayed which gives an idication of where the error is.
>>>>>>>>
>>>>>>>> I wonder if there's any software available to allow me to step
>>>>>>>> through the VBS and identify exactly what's happening as it runs,
>>>>>>>> just as I can with the VB editors in Word and Excel. I don't know
>>>>>>>> if
>>>>>>>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>>>>>>>> third party software. Whilst experts here are just that, I'd find
>>>>>>>> it
>>>>>>>> hard to believe that they can just generate a perfect piece of
>>>>>>>> complicated code out of thin air or debug it, almost as if it's
>>>>>>>> running in their heads!
>>>>>>>> Thanks for your time and patience.
>>>>>>>
>>>>>>> Google is your friend (if you use it <grin>):
>>>>>>> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>>>>>>>
>>>>>>> --
>>>>>>> Microsoft MVP - ASP/ASP.NET
>>>>>>> Please reply to the newsgroup. This email account is my spam trap so
>>>>>>> I
>>>>>>> don't check it very often. If you must reply off-line, then remove
>>>>>>> the
>>>>>>> "NO SPAM"
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Writing and debugging VBS by MikeB

MikeB
Mon Oct 10 11:10:36 CDT 2005


"Tosca" <no-spam@thank-you.com> wrote in message
news:O9Ju05azFHA.612@TK2MSFTNGP10.phx.gbl...
> Thank you - at last I can step through the code! The editor isn't quite as
> sophisticated as the VBA editor in Word or Excel 2003 as I can write code in
> there and it gives an indication of the syntax to be used. I guess VBS isn't
> so easy after all!

You will find a comfort level once you figure out the process you are going to
employ. I still use the VBA editors for prototyping though. I just put the
opening code of the Script file in a Sub Main in a code module and start from
there.

You just remember NOT to use the VBA syntax for variable declaration the only
variable type in Script is Variant and all object instantiation is late bound
using CreateObject or (if server side ServerCreateObject).


> "MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
> news:u4tmTtazFHA.3408@TK2MSFTNGP09.phx.gbl...
>> 1. open a command prompt to the directory of your vbscript file
>>
>> 2 Enter the following command syntax:
>> wscript //x TheNameOfMyScript.vbs
>>
>> This will determine if a debugger is working on your machine or not.
>>
>> It will start whatever debugger is available and enabled. If it starts, the
>> distinguishable difference in operation, is you must set breakpoints inside
>> of functions if you wish to step through line by line...
>>
>>
>>
>>
>> "Tosca" <no-spam@thank-you.com> wrote in message
>> news:%231YKKhWzFHA.2064@TK2MSFTNGP09.phx.gbl...
>>> No - I don't have that line in the code. I've done a considerable amount
>>> of googling but haven't found any explicit instructions about how to use
>>> this editor!
>>>
>>> Any other ideas? I've tried repairing the "Tools" within MS Office from
>>> the installation disc but that's not helped. Similarly, I've run a full AV
>>> scan, just in case the editor isn't working correctly because of viral
>>> infection. It showed no infection!
>>>
>>> "DJP" <djp@snotmail.com> wrote in message
>>> news:Bfh2f.12283$U51.7859@news-server.bigpond.net.au...
>>>>
>>>> Have you got an "on error resume next" somewhere near the top of your
>>>> code? If so, rem that out temporarily then re-run your script and see what
>>>> happens.
>>>>
>>>> "Tosca" <no-spam@thank-you.com> wrote in message
>>>> news:eyqo6JQzFHA.3124@TK2MSFTNGP12.phx.gbl...
>>>>> I'm going to need a bit more guidance!
>>>>>
>>>>> I have a short .vbs file that works fine. I tried to copy and paste it
>>>>> into the VBE in Word or Excel 2003 to step through it, but that drew a
>>>>> blank.
>>>>>
>>>>> I did some googling and found out about MSE7.exe which is on my laptop
>>>>> (XP Pro SP2). I ran it and then File>Open>"name of vbs file". The vbs
>>>>> file opened in Design Mode, so I thought that I'd cracked it! I tried
>>>>> Debug>Step Into (or F11), just as I have used "Step Into" in the VBA
>>>>> Editor in Excel or Word, in the hope that the editor would step through
>>>>> the code for me. If it had, I'd be able to edit the code, or create new
>>>>> code, to modify my project. I was able to run the code (with F5) and the
>>>>> screen changed for a few seconds, before reverting to the design mode. I
>>>>> have tried this with breakpoints set and disabled, but that didn't make
>>>>> any difference. Although the code seems to run, it doesn't produce any
>>>>> of the message boxes that it should, or wait for user interaction.
>>>>>
>>>>> What am I doing wrong? I've looked at the locals window but it says that
>>>>> I cannot evaluate an expression whilst in design mode. I suspect that I
>>>>> need to be out of design mode but have no idea how to do that. I've not
>>>>> been able to find anything in the help facility. How do I use this
>>>>> editor (in a similar way to the VBA editor) to step through my VBS code?
>>>>>
>>>>> Thanks again for your patience!
>>>>>
>>>>>
>>>>>
>>>>> "MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
>>>>> news:%23$D5g1NzFHA.3588@tk2msftngp13.phx.gbl...
>>>>>> Also,
>>>>>> It is quite common to simply plunk you vbscript code into a code
>>>>>> module in the VBA editor of any Office App and prototype it there before
>>>>>> launching it in the pure scripting environ.
>>>>>>
>>>>>>
>>>>>> "Tosca" <no-spam@thank-you.com> wrote in message
>>>>>> news:%23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
>>>>>>> Thank you Bob for the rapid reply. The first hit is the Microsoft
>>>>>>> Script Debugger so it looks like I need that one. There's no
>>>>>>> indication about how to get hold of a copy so I'll do some research.
>>>>>>> There's no suggestion that it's on my PC already.
>>>>>>>
>>>>>>> "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
>>>>>>> news:OtIzr7MzFHA.3312@TK2MSFTNGP09.phx.gbl...
>>>>>>>> Tosca wrote:
>>>>>>>>> Hi everyone
>>>>>>>>>
>>>>>>>>> I've used the Visual Basic Editor in Word and Excel 2003 and have
>>>>>>>>> decided to delve into VBS. I've managed to copy script samples from
>>>>>>>>> various sites, paste them into Notepad and save the file with a .vbs
>>>>>>>>> extension. Needless to say, the samples do what they're supposed to
>>>>>>>>> but, if I modify the code to do something slightly different, it
>>>>>>>>> either works or it doesn't. If it doesn't, an error messagebox is
>>>>>>>>> displayed which gives an idication of where the error is.
>>>>>>>>>
>>>>>>>>> I wonder if there's any software available to allow me to step
>>>>>>>>> through the VBS and identify exactly what's happening as it runs,
>>>>>>>>> just as I can with the VB editors in Word and Excel. I don't know if
>>>>>>>>> there's anything on my laptop already (XP Pro SP2) or if I'd need
>>>>>>>>> third party software. Whilst experts here are just that, I'd find it
>>>>>>>>> hard to believe that they can just generate a perfect piece of
>>>>>>>>> complicated code out of thin air or debug it, almost as if it's
>>>>>>>>> running in their heads!
>>>>>>>>> Thanks for your time and patience.
>>>>>>>>
>>>>>>>> Google is your friend (if you use it <grin>):
>>>>>>>> http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=gd&q=script+debugger
>>>>>>>>
>>>>>>>> --
>>>>>>>> Microsoft MVP - ASP/ASP.NET
>>>>>>>> Please reply to the newsgroup. This email account is my spam trap so I
>>>>>>>> don't check it very often. If you must reply off-line, then remove the
>>>>>>>> "NO SPAM"
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>



Re: Writing and debugging VBS by mosow

mosow
Tue Oct 11 07:17:29 CDT 2005

I use the Microsoft Development Environment for both writing and
debugging scripts. I find it to be the best tool for both. It can be
set up to be the default debugger when you use the //X switch when
running your script.


Re: Writing and debugging VBS by Tosca

Tosca
Tue Oct 11 11:03:22 CDT 2005

Thank you. I've checked Google and the only reference that I could see
regarding the source of Microsoft Development Environment is in Visual
Studio. Is that where you gained access? If so, which version of Visual
Studio do you have? Am I correct in thinking that I could write and debug
scripts in other languages with this? It mentions Visual Basic, Visual C++
etc. but not Visual Basic Script (what I'm trying to master!).

Forgive me if this seems a trivial/stupid question, but I have no experience
of scripts, other than copying and pasting them into Notepad to save as a
.vbs file!

"mosow" <jmosow@yahoo.com> wrote in message
news:1129033049.097919.117700@g14g2000cwa.googlegroups.com...
>I use the Microsoft Development Environment for both writing and
> debugging scripts. I find it to be the best tool for both. It can be
> set up to be the default debugger when you use the //X switch when
> running your script.
>



Re: Writing and debugging VBS by ahall

ahall
Wed Oct 12 10:24:18 CDT 2005

>>>>> MikeB writes:

MikeB> 1. open a command prompt to the directory of your vbscript file
MikeB> 2 Enter the following command syntax:
MikeB> wscript //x TheNameOfMyScript.vbs

MikeB> This will determine if a debugger is working on your machine or not.

MikeB> It will start whatever debugger is available and enabled. If it starts, the
MikeB> distinguishable difference in operation, is you must set breakpoints inside of
MikeB> functions if you wish to step through line by line...


If no debugger pops up, how does one enable it? I can
get to it via the Excel Macro's menu, but have the same
issues as Tosca, I cannot run the macro in the debbuger.

The /xx just runs the macro, and does not start a debugger.

Thanks,
ah

MikeB> "Tosca" <no-spam@thank-you.com> wrote in message
news> %231YKKhWzFHA.2064@TK2MSFTNGP09.phx.gbl...
>> No - I don't have that line in the code. I've done a considerable amount of
>> googling but haven't found any explicit instructions about how to use this
>> editor!
>>
>> Any other ideas? I've tried repairing the "Tools" within MS Office from the
>> installation disc but that's not helped. Similarly, I've run a full AV scan,
>> just in case the editor isn't working correctly because of viral infection.
>> It showed no infection!
>>
>> "DJP" <djp@snotmail.com> wrote in message
news> Bfh2f.12283$U51.7859@news-server.bigpond.net.au...
>>>
>>> Have you got an "on error resume next" somewhere near the top of your code?
>>> If so, rem that out temporarily then re-run your script and see what
>>> happens.
>>>
>>> "Tosca" <no-spam@thank-you.com> wrote in message
news> eyqo6JQzFHA.3124@TK2MSFTNGP12.phx.gbl...
>>>> I'm going to need a bit more guidance!
>>>>
>>>> I have a short .vbs file that works fine. I tried to copy and paste it
>>>> into the VBE in Word or Excel 2003 to step through it, but that drew a
>>>> blank.
>>>>
>>>> I did some googling and found out about MSE7.exe which is on my laptop (XP
>>>> Pro SP2). I ran it and then File>Open>"name of vbs file". The vbs file
>>>> opened in Design Mode, so I thought that I'd cracked it! I tried
Debug> Step Into (or F11), just as I have used "Step Into" in the VBA Editor
>>>> in Excel or Word, in the hope that the editor would step through the code
>>>> for me. If it had, I'd be able to edit the code, or create new code, to
>>>> modify my project. I was able to run the code (with F5) and the screen
>>>> changed for a few seconds, before reverting to the design mode. I have
>>>> tried this with breakpoints set and disabled, but that didn't make any
>>>> difference. Although the code seems to run, it doesn't produce any of the
>>>> message boxes that it should, or wait for user interaction.
>>>>
>>>> What am I doing wrong? I've looked at the locals window but it says that I
>>>> cannot evaluate an expression whilst in design mode. I suspect that I need
>>>> to be out of design mode but have no idea how to do that. I've not been
>>>> able to find anything in the help facility. How do I use this editor (in a
>>>> similar way to the VBA editor) to step through my VBS code?
>>>>
>>>> Thanks again for your patience!
>>>>
>>>>
>>>>
>>>> "MikeB" <m.byerleyATVerizonDottieNettie> wrote in message
news> %23$D5g1NzFHA.3588@tk2msftngp13.phx.gbl...
>>>>> Also,
>>>>> It is quite common to simply plunk you vbscript code into a code module
>>>>> in the VBA editor of any Office App and prototype it there before
>>>>> launching it in the pure scripting environ.
>>>>>
>>>>>
>>>>> "Tosca" <no-spam@thank-you.com> wrote in message
news> %23$20rFNzFHA.2880@TK2MSFTNGP12.phx.gbl...
>>>>> Thank you Bob for the rapid reply. The first hit is the Microsoft Script
>>>>> Debugger so it looks like I need that one. There's no indication about
>>>>> how to get hold of a copy so I'll do some research. There's no suggestion
>>>>> that it's on my PC already.
>>>>>>
>>>>> "Bob Barrows [MVP]" <