Macros in different workbooks
Amazing chart utilities from Jon Peltier
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 9 of 9

Thread: Macros in different workbooks

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    SRC
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Does anyone know how to call a macro that is in one workbook from another in Excel 2000

  2. #2
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,605
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-02-19 13:21, JohnG wrote:
    Does anyone know how to call a macro that is in one workbook from another in Excel 2000
    If you have both workbooks open, you can just call the macro by it's name (unless you've declared the Sub/Function as Private).

    -rh

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    SRC
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I tried just typing the macro name in and got the error message that sub or function had not been created.
    On 2002-02-19 13:31, Russell Hauf wrote:
    On 2002-02-19 13:21, JohnG wrote:
    Does anyone know how to call a macro that is in one workbook from another in Excel 2000
    If you have both workbooks open, you can just call the macro by it's name (unless you've declared the Sub/Function as Private).

    -rh

  4. #4
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,605
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Are both workbooks open? Also, how are you calling your functions? Can you post the code that you are calling FROM and the code that you are calling?

    Thank you,

    -rh

  5. #5
    Board Regular
    Join Date
    Feb 2002
    Location
    SRC
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Both books are open

    'Workbook "Test"
    Sub CallMacro()
    CallTestMacro
    End Sub

    'Workbook "CallTest"
    Sub CallTestMacro()
    Msgbox "Routine called",VBOkOnly, Thisworkbook.name
    End Sub
    On 2002-02-19 14:04, Russell Hauf wrote:
    Are both workbooks open? Also, how are you calling your functions? Can you post the code that you are calling FROM and the code that you are calling?

    Thank you,

    -rh

  6. #6
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Can you not use personal.xls ???

    Thats what its for!

    Rdgs
    ==========
    Jack

  7. #7
    Legend NateO's Avatar
    Join Date
    Feb 2002
    Location
    Minneapolis, Mn, USA
    Posts
    9,700
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    How's about:

    application.run("CallTestMacro")

    instead of "CallTestMacro"

    Cheers,

    Nate

    [ This Message was edited by: NateO on 2002-02-19 14:41 ]

  8. #8
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,605
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try this:

    Application.Run ("CallTest.xls!CallTestMacro")

    -rh

  9. #9
    Board Regular
    Join Date
    Feb 2002
    Location
    SRC
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Thanks all it works now....If the workbook is found to be open the macro is called.
    On 2002-02-19 14:52, Russell Hauf wrote:
    Try this:

    Application.Run ("CallTest.xls!CallTestMacro")

    -rh

User Tag List

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
  •  

 

 
DMCA.com