Difference between VBS and VBA

Solved
steffy56 -  
steffy74 Posted messages 25 Status Member -
Hello,

I’m starting with VB and I’m having trouble creating VBS scripts that interact with Excel. VBA and VBS syntax are not the same, and when I try to take VBA code and put it into a script I get errors. Is there any help on the differences between VBS and VBA?

I’m a bit lost

Thank you for your help

Configuration: Windows XP Firefox 3.0.1

3 answers

  1. michel_m Posted messages 18903 Registration date   Status Contributor Last intervention   3 320
     
    Hello

    yes indeed, e.g. a msgbox in VBA becomes Wscript.echo in VBS... above all, stay zen!!!

    this site might help you
    http://www.host-web.com/iishelp/VBScript/htm/VBStoc.htm

    Good luck!
    --
    Michel
    0
  2. steffy74 Posted messages 25 Status Member 1
     
    Hello,

    Thank you for the information but that's not exactly what I'm looking for. I would like to know the syntax to drive Excel in VBScript.

    For example, how can I translate the following VBA: ActiveWindow.DisplayGridlines = False (which hides the gridlines) into VBScript?

    Thank you for your help as I'm going in circles !!!!
    0
  3. steffy74 Posted messages 25 Status Member 1
     
    Good, I’ve solved my problem:
    AppXlS.ActiveWindow.DisplayGridlines = False with
    AppXlS = Wscript.CreateObject("Excel.Application")

    there you go, it wasn’t complicated after all!

    Thanks
    0