+ Reply to Thread
Results 1 to 5 of 5

How to execute the ".bat" files using excel VBA !?

  1. #1
    Registered User
    Join Date
    12-17-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Unhappy How to execute the ".bat" files using excel VBA !?

    Dear all,

    I was created a macro VBA to run ".BAT" files so I can copy some documents with different formats into excel.
    When I try on my ".BAT" files created by execute it manually was running fine without any problems.
    However, I was failed to get my results when I tried to execute the ".BAT" files with excel macro VBA.

    Can anyone helps me on this? Below is my VBA codes created.

    Thanks in advance.

    __________________________________________________________________________
    Please Login or Register  to view this content.
    _______________________________________________________________________________________________
    Last edited by CSLim; 06-22-2014 at 10:50 PM.
    Best Regards,
    CSLim

  2. #2
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: How to execute the ".bat" files using excel VBA !?

    Hi,

    you can simply do this :

    Please Login or Register  to view this content.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  3. #3
    Registered User
    Join Date
    12-17-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: How to execute the ".bat" files using excel VBA !?

    Hi xlbiznes,

    I'm just tried your advice just now and test run the VBA still resulted failed to get my results.
    Any ideas?
    Untitled.jpg
    Last edited by CSLim; 06-19-2014 at 04:30 AM. Reason: Add photo as attachment

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: How to execute the ".bat" files using excel VBA !?

    Hi,

    Please enclose the code of your first post in the code block.

    firstly ,Does your batch file get executed from the vba ?

    What i have understood now is that your batch file executes but no result is derived from it.

    On the other hand if you run the batch file from the command prompt you are able to get the desired result.

  5. #5
    Registered User
    Join Date
    12-17-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: How to execute the ".bat" files using excel VBA !?

    Hi xlbiznes,

    Done enclose the codes of my first post in code block as your advice. Thanks.

    For your info, my batch files did execute with VBA but no results is derived from it as your finding.
    I tried to execute the batch files manually by double click on the batch files are able to get the desired results without any problems.

    Any advice on this?
    Is there any problems with my codes?

    Kindly helps me on this. Thanks in advance and appreciate your helps.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Open files from FTP server (works with "servername" but doesn't work with "ip address")
    By adammsu1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2012, 04:30 PM
  2. Displaying "All Files" instead of "All Excel Files"
    By Ernesto in forum Excel General
    Replies: 0
    Last Post: 07-12-2012, 11:06 AM
  3. search directory for excel-files and put A136 from tab "1"-"20" in a table
    By Wim_VDW in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2012, 10:33 AM
  4. Placing an "Execute" button in Excel...
    By ltipto1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2009, 04:47 AM
  5. Placing an "Execute" button on Excel ...
    By ltipto1 in forum Excel General
    Replies: 1
    Last Post: 06-18-2009, 09:25 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1