Closed Thread
Results 1 to 3 of 3

Calling a Personal.XLS Sub from anther workbook's 'This Workbook' Sheet Activate

  1. #1
    Jack Gillis
    Guest

    Calling a Personal.XLS Sub from anther workbook's 'This Workbook' Sheet Activate

    I have a Sub in module1 of Personal.XLS. I can run it from Tools/Macro
    just fine from any Workbook. However, I would like to be able to run it
    from any Workbook's 'This Workbook'/Sheet Activate.

    The Sub's name is RemovePI. I put 'Call RemovePI' in Sheet activate and
    that produced an error saying something like "Sub or Function not
    defined." I tried Call [Personal.XLS].[Module1].RemovePI' and got an
    error 424-Object Required. I then tried to establish a reference to
    Personal.xls to see if that would cure the problem but was not allowed
    to do it.

    I then tried Run RemovePI. That didn't give an error but didn't appear
    to execute the Sub. I had a breakpoing set in the Sub and it never
    reached it. When run from Tool/Macro. the breakpoint was hit.

    I've exhausted my ability to Google the problem as well as Google Groups
    it and have not found a solution.

    Can someone help me execute the macro from Sheet Activate?

    Thank you very much.



  2. #2
    Bob Phillips
    Guest

    Re: Calling a Personal.XLS Sub from anther workbook's 'This Workbook' Sheet Activate

    Application.Run "'Personal.xls!RemovePI"


    --
    HTH

    Bob Phillips

    "Jack Gillis" <[email protected]> wrote in message
    news:[email protected]...
    > I have a Sub in module1 of Personal.XLS. I can run it from Tools/Macro
    > just fine from any Workbook. However, I would like to be able to run it
    > from any Workbook's 'This Workbook'/Sheet Activate.
    >
    > The Sub's name is RemovePI. I put 'Call RemovePI' in Sheet activate and
    > that produced an error saying something like "Sub or Function not
    > defined." I tried Call [Personal.XLS].[Module1].RemovePI' and got an
    > error 424-Object Required. I then tried to establish a reference to
    > Personal.xls to see if that would cure the problem but was not allowed
    > to do it.
    >
    > I then tried Run RemovePI. That didn't give an error but didn't appear
    > to execute the Sub. I had a breakpoing set in the Sub and it never
    > reached it. When run from Tool/Macro. the breakpoint was hit.
    >
    > I've exhausted my ability to Google the problem as well as Google Groups
    > it and have not found a solution.
    >
    > Can someone help me execute the macro from Sheet Activate?
    >
    > Thank you very much.
    >
    >




  3. #3
    Jack Gillis
    Guest

    Re: Calling a Personal.XLS Sub from anther workbook's 'This Workbook' Sheet Activate

    Thank you, Bob. That did the trick!

    "Bob Phillips" <[email protected]> wrote in message
    news:%[email protected]...
    > Application.Run "'Personal.xls!RemovePI"
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > "Jack Gillis" <[email protected]> wrote in message
    > news:[email protected]...
    >> I have a Sub in module1 of Personal.XLS. I can run it from
    >> Tools/Macro
    >> just fine from any Workbook. However, I would like to be able to run
    >> it
    >> from any Workbook's 'This Workbook'/Sheet Activate.
    >>
    >> The Sub's name is RemovePI. I put 'Call RemovePI' in Sheet activate
    >> and
    >> that produced an error saying something like "Sub or Function not
    >> defined." I tried Call [Personal.XLS].[Module1].RemovePI' and got an
    >> error 424-Object Required. I then tried to establish a reference to
    >> Personal.xls to see if that would cure the problem but was not
    >> allowed
    >> to do it.
    >>
    >> I then tried Run RemovePI. That didn't give an error but didn't
    >> appear
    >> to execute the Sub. I had a breakpoing set in the Sub and it never
    >> reached it. When run from Tool/Macro. the breakpoint was hit.
    >>
    >> I've exhausted my ability to Google the problem as well as Google
    >> Groups
    >> it and have not found a solution.
    >>
    >> Can someone help me execute the macro from Sheet Activate?
    >>
    >> Thank you very much.
    >>
    >>

    >
    >




Closed 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