Re: Writing and debugging VBS



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@xxxxxxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxx> wrote in message
> news:%23$20rFNzFHA.2880@xxxxxxxxxxxxxxxxxxxxxxx
>> 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@xxxxxxxxxxxxxxx> wrote in message
>> news:OtIzr7MzFHA.3312@xxxxxxxxxxxxxxxxxxxxxxx
>>> 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"
>>>
>>
>>
>
>


.



Relevant Pages

  • Runtime Error! when form is opened in design mode
    ... actually) form in design mode and then hit Alt-F11 to open the VBA editor, ... this error message displays (the dialog box is entitled: ... The error also happens if the VBA editor is already open and I try to design ...
    (microsoft.public.access.formscoding)
  • Re: How do I find Control toolbox in Office2007
    ... Have test it in Beta2 and in Beta2TRand in both double clicking the activex button ... will bring up the click event in the VBA editor ... The Design mode option is also on the Developers tab ... allow me to bring up a form from the worksheet. ...
    (microsoft.public.excel.programming)