+ Reply to Thread
Results 1 to 6 of 6

Open specific workbook and run a macro within

  1. #1
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Open specific workbook and run a macro within

    Hi,

    I am trying to open a specific workbook WorkbookB in a specific folder to run a macro within it. I am planning to call the macro from WorkbookB into another one in WorkbookA. The macro in WorkbookA should do something, then call the one from WorkbbokB, wait for MacroB to do the job, and then to continue to do other things.
    My problem lies in the fact that the below macro opens the file, but it doesn't run the macro within it. No errors occured. Any ideas why?
    Please Login or Register  to view this content.
    ACSessions is the module
    CopyFilteredValuesToActiveWorkbookACSessions is the macro

    Thanks,
    Paul

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Open specific workbook and run a macro within

    How are you triggering the OpenAndRun macro?

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Open specific workbook and run a macro within

    The situation is like this: I have 10 macro in workbookA. I use a master macro to call them in order mostly to keep it simple. This works. In WorkbookB I have 7 macro, and I use a master one as well. I am plannig to set this one in the master macro in WorkbookA. Currently I try to test it using a single macro, the most simple one in WorkbookB.
    Application.Run - this should run the macro

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Open specific workbook and run a macro within

    That doesn't answer my question though. How are you running OpenAndRun? From the macros dialog, a keyboard shortcut, f5 in the VBE, or something else?

    Also, have you tried stepping through the code to see what happens?

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Open specific workbook and run a macro within

    F5 in VBE.

    But I took another approach and managed to fix it. Thank you anyway

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Open specific workbook and run a macro within

    Care to share the solution in case it benefits someone else in the future?

+ 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. Macro to close and re-open a workbook at specific time
    By hasanqz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2015, 03:38 PM
  2. macro to open files and copy specific sheet into new workbook (have open files part)
    By dangerdavedsp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 02:23 PM
  3. Run Macro Automatically When I open a specific workbook
    By trent.bourne in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2013, 12:28 AM
  4. [SOLVED] Run Macro Automatically When I open a specific workbook
    By trent.bourne in forum Excel General
    Replies: 1
    Last Post: 11-29-2013, 11:45 PM
  5. Macro to exit all workbook leaving one specific workbook open
    By Khanzaki in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-22-2013, 05:09 AM
  6. [SOLVED] Macro to open workbook and go to specific worksheet based on cell reference
    By ajmartin17 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2013, 10:44 AM
  7. Macro that promps user to open a specific workbook
    By ExcelHelpBen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-02-2012, 07:19 AM

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