Results 1 to 2 of 2

Thread: Can I run batch-files by VBA ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2003
    Posts
    1

    Can I run batch-files by VBA ?

    Hi,


    I really want to know whether it's possible to run batch-files with VBA or not.
    Second question: How do I do that ?

    The situation is as follows (pretty simple actually):
    I'm running an App (let's say Excel or Access 2000).
    While running this program I want to run a batch-file (.bat) which executes a photo-resizing and renaming-program.

    I did find the AppActivate- and Shell-functions, and they seem to work (çause I don't get an errormessage), but it doesn't seem to execute the command-lines in the batch-file.

    Hope some good-hearted VBA-freak can help me out here !
    Thanks in advance.

  2. #2
    Junior Member
    Join Date
    Jul 2003
    Posts
    25
    Build your command line in a string, then use the shell command:


    VB Code:
    1. dim sCmd as string
    2.  
    3. '  code to build sCmd here
    4.  
    5. Shell sCmd

Posting Permissions

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



Click Here to Expand Forum to Full Width