+ 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
    Forum Expert 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.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  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,520

    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