View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default How do I write a VBA script that runs from the DOS prompt window?


cmhoward wrote:
I use VBA with EXCEL and want to write and run a VBA script that can be run
from the DOS prompt and uses Windows XP but no EXCEL services.


Expanding on what Tom said - what you want to do is simply impossible.
VBA needs a host application to run in. *But* - VBScript is a quite
similar language that can run by itself in Windows XP. As a language,
VBScript is better than VBA in some ways (built in regular expression
support and dictionaries (associative arrays)) and worse in others
(variant is the only type - a blemish in my book, plus it doesn't come
with a nice IDE). It is an interpreted language and is thus noticably
slower than the quasi-compiled VBA, but for scripts designed to run
from a DOS prompt this probably isn't an issue. The learning curve in
going from VBA to VBScript is very small. Often, a program that you
have written in Excel VBA (if it doesn't really use Excel) can be
turned into a functioning VBScript program in a matter of minutes.

Hope that helps

-John Coleman