+ Reply to Thread
Results 1 to 4 of 4

run an excel macro from a batch file

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    4

    run an excel macro from a batch file

    Hi,

    I am new to excel macros.
    I need to run a macro from command prompt, basically a batch file(.BAT).
    I have written the macro and it runs perfectly from the excel file.
    But I don't know how to execute it from a batch file.

    Thanks in advance.

  2. #2
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: run an excel macro from a batch file

    It can probably be converted into a .vbs script file, similar to a .bat file except it will run VBA-like code.

    Post the script. Be sure to put CODE tags around it as shown in my signature, as per the forum rules.

  3. #3
    Registered User
    Join Date
    10-15-2012
    Location
    Bangalore
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: run an excel macro from a batch file

    Hi,

    I have saved the following Uppercase() macro in the file 'Sample.xlsm'.
    I need to run it in a batch file. How to run this?
    Moreover, I have heard that .vbs are prone to virus... Is it true?




    Please Login or Register  to view this content.

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,517

    Re: run an excel macro from a batch file

    I can convert this to vbs. Is this just for 1 file?
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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