Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was given a spreadsheet for 1st Quarter with a drop-down ment that
calls a macro that recalcs all my pivot tables and one of the first items in that procedure is ThisWorkbook.Activate. I copied the whole workbook and made one for 2nd Quarter. If I open the 1st Quarter one and the menu appears, and then I open the 2nd Quarter one... there is still only one menu (as they are exactly the same)... if I click the menu and run the macro, which workbook will it run on? I envision one of three possible answers: the first one I opened, the last one I opened, whichever workbook was active. Help! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thisworkbook refers to the workbook that holds the code.
Look at the properties of the menu button and see which macro is assigned to the button. -- Regards, Tom Ogilvy " wrote: I was given a spreadsheet for 1st Quarter with a drop-down ment that calls a macro that recalcs all my pivot tables and one of the first items in that procedure is ThisWorkbook.Activate. I copied the whole workbook and made one for 2nd Quarter. If I open the 1st Quarter one and the menu appears, and then I open the 2nd Quarter one... there is still only one menu (as they are exactly the same)... if I click the menu and run the macro, which workbook will it run on? I envision one of three possible answers: the first one I opened, the last one I opened, whichever workbook was active. Help! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Unfortunately, both workbooks hold the exact same code. If I open
either workbook, I get the one menu. However, if I open both workbooks at once, I only get one menu. Which workbooks menu am I seeing? On Jul 5, 10:38 am, Tom Ogilvy wrote: thisworkbook refers to the workbook that holds the code. Look at the properties of the menu button and see which macro is assigned to the button. -- Regards, Tom Ogilvy " wrote: I was given a spreadsheet for 1st Quarter with a drop-down ment that calls a macro that recalcs all my pivot tables and one of the first items in that procedure is ThisWorkbook.Activate. I copied the whole workbook and made one for 2nd Quarter. If I open the 1st Quarter one and the menu appears, and then I open the 2nd Quarter one... there is still only one menu (as they are exactly the same)... if I click the menu and run the macro, which workbook will it run on? I envision one of three possible answers: the first one I opened, the last one I opened, whichever workbook was active. Help!- Hide quoted text - - Show quoted text - |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Depends, if the code deletes the menu before re-creating it, it will be the
second. If it doesn't, the second probably fails when creating it. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message ups.com... I was given a spreadsheet for 1st Quarter with a drop-down ment that calls a macro that recalcs all my pivot tables and one of the first items in that procedure is ThisWorkbook.Activate. I copied the whole workbook and made one for 2nd Quarter. If I open the 1st Quarter one and the menu appears, and then I open the 2nd Quarter one... there is still only one menu (as they are exactly the same)... if I click the menu and run the macro, which workbook will it run on? I envision one of three possible answers: the first one I opened, the last one I opened, whichever workbook was active. Help! |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 5, 11:12 am, "Bob Phillips" wrote:
Depends, if the code deletes the menu before re-creating it, it will be the second. If it doesn't, the second probably fails when creating it. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message ups.com... I was given a spreadsheet for 1st Quarter with a drop-down ment that calls a macro that recalcs all my pivot tables and one of the first items in that procedure is ThisWorkbook.Activate. Thanks.. I looked at the code and it does indeed delete it first. Therefore the most recently opened one would be the one. I copied the whole workbook and made one for 2nd Quarter. If I open the 1st Quarter one and the menu appears, and then I open the 2nd Quarter one... there is still only one menu (as they are exactly the same)... if I click the menu and run the macro, which workbook will it run on? I envision one of three possible answers: the first one I opened, the last one I opened, whichever workbook was active. Help!- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Activate Object question | Excel Worksheet Functions | |||
ThisWorkbook.Print question | Excel Discussion (Misc queries) | |||
'ThisWorkbook' Macro Question | Excel Programming | |||
ThisWorkbook module question | Excel Programming |