+ Reply to Thread
Results 1 to 3 of 3

Running a macro saved in the Personal.xlsb file from a batch file

  1. #1
    Registered User
    Join Date
    04-26-2021
    Location
    Dublin
    MS-Off Ver
    Office 365
    Posts
    3

    Running a macro saved in the Personal.xlsb file from a batch file

    Hello,

    I'm trying to write a batch file that opens 2 Excel sheets and launches one macro that performs actions on both files.

    So far I have a batch file that launches Excel, opens both files and activates the one from which the Macro must be run. But I am struggling to call the Macro as it is stored in the Personal.xlsb file and not in either spreadsheets.

    I tried to post the code I had so far but I keep getting an error saying I can't post any links until I have posted a few times...I'm using Application.Run to call the Macro but that is not working at all!!

    Help would be very much appreciated!!

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Running a macro saved in the Personal.xlsb file from a batch file

    That is odd. If you clicked the # icon on the reply toolbar and pasted the code between the tags, it should not have done that.

    If you run it manually, it should work when you automate it.

    Here is how I would do it. mTest is the Module that testFillRowColNums() is in.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-26-2021
    Location
    Dublin
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Running a macro saved in the Personal.xlsb file from a batch file

    Hello Kenneth,

    Thank you very much for your input. I'm afraid I am quite a beginner in this and I'm still like my name desperada

    I will attempt to paste my very simple code again that works. I then need to run a super long Vb Macro that does a few operations between 2 files.
    I believe the Application.Run function is a VB function, whereas I'm using batch commands. How can I interact with VB language in a batch file? Or can I? How do I bridge between both script languages?
    Sorry it's a very basic question but I'm very willing to learn

    BTW I attempted to post my simple code in between ## and it's saying "You are not allowed to post any kinds of links, images or videos until you post a few times."
    Last edited by LadyDesperada; 05-14-2021 at 06:40 AM.

+ 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. [SOLVED] Running macro from personal.xlsb not working
    By Grilleman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2019, 10:26 AM
  2. Replies: 2
    Last Post: 07-05-2017, 11:33 AM
  3. Replies: 1
    Last Post: 03-14-2016, 12:41 PM
  4. Running a Personal.XLSB Macro From Within Another Personal.XLSB Macro
    By js0873 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 06-23-2015, 09:58 AM
  5. Replies: 7
    Last Post: 03-30-2015, 05:51 PM
  6. Replies: 0
    Last Post: 01-15-2015, 05:53 AM
  7. [SOLVED] Run PERSONAL.XLSB macro when any Excel file is opened
    By Aaron092 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2014, 04:35 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