+ Reply to Thread
Results 1 to 6 of 6

Macro to Run macro in another closed workbook

  1. #1
    Registered User
    Join Date
    08-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    26

    Macro to Run macro in another closed workbook

    Hello,

    So what I am trying to do, but am having trouble is have a macro open another workbook I have saved somewhere, then running a macro that I have set up in that workbook, then close without saving.

    Any help would be appreciated!

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Macro to Run macro in another closed workbook

    Hello there,

    Change the text in red to the workbook you'd like to open's filepath, if you don't know it open the workbook and in a blank cell type =CELL("filename") this will tell you the filepath.

    Please Login or Register  to view this content.
    Then set the macro/code you want to run in the workbook you are opening to the workbook's on open event or the way the code is set up you can type the code you want to run before the .close False line
    Last edited by rvasquez; 08-22-2012 at 03:53 PM.

  3. #3
    Registered User
    Join Date
    08-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Macro to Run macro in another closed workbook

    Thanks alot!!!

  4. #4
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Macro to Run macro in another closed workbook

    No problem!

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Macro to Run macro in another closed workbook

    THis is a little old and hoping to get an answer. I am attempting to run a macro that I have in the second workbook and save it. The file is on a network folder and it is a database that I import test data into. I have the following code.

    Please Login or Register  to view this content.
    With copydataroutine being the macro I want to run in the database file.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 2000/3/7/10/13/16
    Posts
    51,801

    Re: Macro to Run macro in another closed workbook

    Quote Originally Posted by j007conks View Post
    THis is a little old and hoping to get an answer. I am attempting to run a macro that I have in the second workbook and save it. The file is on a network folder and it is a database that I import test data into. I have the following code.

    Please Login or Register  to view this content.
    With copydataroutine being the macro I want to run in the database file.
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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