+ Reply to Thread
Results 1 to 4 of 4

Run Macro in one Workbook From another

  1. #1
    Registered User
    Join Date
    05-22-2009
    Location
    Shirland, IL
    MS-Off Ver
    Excel '00 & '03
    Posts
    51

    Run Macro in one Workbook From another

    Here's the situation:

    I have a vba Project that asks the user if he/she wants to add an option. If he or she choses "no", the the sub exits. If they choose "yes" then the code opens a workbook template, saves it with a specific name, and takes the user there.

    What I need is for a specific macro to be run, (exists in the template book) only when opening the workbook through this method.

    Any ideas?

    If you have trouble understanding what i mean, just let me know and i'll try and be more clear.

    Thanks
    Last edited by fire_water; 06-30-2009 at 03:58 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Run Macro in one Workbook From another

    It would be much simpler to have the macro in the main workbook.

    If this is not possible declare the new workbook as an Object Variable hen use that variable to run the macro.

    Post the code that you are currently using then I can show you what i mean.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    05-22-2009
    Location
    Shirland, IL
    MS-Off Ver
    Excel '00 & '03
    Posts
    51

    Re: Run Macro in one Workbook From another

    Thanks, I went ahead and did some modifying and put it in the main workbook and it works fine now.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Run Macro in one Workbook From another

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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