Consulting

Results 1 to 4 of 4

Thread: Batch file

  1. #1

    Batch file

    guys how to run a vba code by a batch file
    like fpr cqperl i can write a batch file sayin
    cqperl filename.pl

    how to make a batch file which will execute a vba code?

    asking this in this section as vba code is in excel(although tht doesnt matter much)

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,455
    Location
    Why not rewrite it as VBScript. It is very similar, just that there are no variable type declarations, they all defdault.

    VBScript can be run in batch mode.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    @start Book1.xls

    in the first line of a file named filname.bat will start Book1.xls if it is in the same directory. It won't run any VBA for you unless Book1.xls has on open event code in it.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  4. #4
    hmm thanks..actually my problem is little bit complicated to type out correctly..but i am giving it a try....this is what my program should do
    1)open a browser dialog window...
    2)when i click on a particular xls file it opens tht file...
    3)executes the vba code i have developed
    4)the modifications(result) obtained are stored either in the same xls file as new sheet.. or as a new workbook altogether!

    Note : the help i had taken earlier is used to develop the vba code i.e deleting empty rows etc etc!

    P.S : my god u guys are quick !! thanks a lot guys!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •