Results 1 to 5 of 5

Thread: How to call and run a Macro (StatusV2) stored on Workbook1 onto Workbook2
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Oct 2017
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default How to call and run a Macro (StatusV2) stored on Workbook1 onto Workbook2

    Hi All

    How do I run a macro module. This macro is on workbook1 and everyday i want it to be run on a another workbook (named workbook2). Workbook2 needs to be non macro enabled workbook. Both the Workbook are opened.
    I was not able to get any appropriate code which completes this action. Any assistance would be appreciated.

    I dont think the following code is of any help in the above scenario.

    Application
    .Run "'"& Workbook1&"'!StatusV2"

    Thanks
    Vaghy


  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: How to call and run a Macro (StatusV2) stored on Workbook1 onto Workbook2

    If workbook2 has to be an .xlsx file then you cannot call a macro from it.
    However if at the top of your macro insert
    Code:
    Workbooks("Workbook2.xlsx").activate
    That might enable you to do what you're after.
    If that doesn't work you'll need to post your code here
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    New Member
    Join Date
    Oct 2017
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to call and run a Macro (StatusV2) stored on Workbook1 onto Workbook2

    the following code has worked.... Is it the most efficient way?

    Windows("Workbook2.xlsx").Activate

  4. #4
    New Member
    Join Date
    Oct 2017
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to call and run a Macro (StatusV2) stored on Workbook1 onto Workbook2

    Quote Originally Posted by Fluff View Post
    If workbook2 has to be an .xlsx file then you cannot call a macro from it.
    However if at the top of your macro insert
    Code:
    Workbooks("Workbook2.xlsx").activate
    That might enable you to do what you're after.
    If that doesn't work you'll need to post your code here

    thanks for your assistance

  5. #5
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    29,229
    Post Thanks / Like
    Mentioned
    483 Post(s)
    Tagged
    49 Thread(s)

    Default Re: How to call and run a Macro (StatusV2) stored on Workbook1 onto Workbook2

    Glad to help & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •