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

  • Thread starter Thread starter Jack Gillis
  • Start date Start date
J

Jack Gillis

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.
 
Thank you, Bob. That did the trick!

Bob Phillips said:
Application.Run "'Personal.xls!RemovePI"


--
HTH

Bob Phillips

Jack Gillis said:
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.
 
Back
Top