Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
application run - macros within macros
Hi there,
I have a number of macros that I want to be activated in a series by attaching them all to one 'button' on the work sheet they relate to. That works fine to start with but because the workbook will be opened and then saved with a different name by users, the "Application run ......xls ..Sheet13."macroname" approach means an error message about not finding the macro. How do I code this so that the macros can be found whatever the user names the book after opening it. Thanks Sybs |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
application run - macros within macros
If all the macro (subroutines) are in one workbook, then just ue the call
mysub(parm1,parrm2,...). No workbook references are required. "SYBS" wrote: Hi there, I have a number of macros that I want to be activated in a series by attaching them all to one 'button' on the work sheet they relate to. That works fine to start with but because the workbook will be opened and then saved with a different name by users, the "Application run ......xls .Sheet13."macroname" approach means an error message about not finding the macro. How do I code this so that the macros can be found whatever the user names the book after opening it. Thanks Sybs |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
application run - macros within macros
Thanks Joel,
Sorry to be so thick, how do I phrase it? As in this is what I presently have. Howe do I phrase it correctly? 'THIS IS THE MACRO THAT CALLS THE SUBS TO UPDATE THE RESULTS PAGE' Sub UPDATERESULTSHEET() ActiveSheet.Unprotect ("sybs") Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postFootlockresultsmen" Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postthrowresultsmen" Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postSpeedclimbresultsmen" "Joel" wrote: If all the macro (subroutines) are in one workbook, then just ue the call mysub(parm1,parrm2,...). No workbook references are required. thanks so much for the help appreciated. Sybs "SYBS" wrote: Hi there, I have a number of macros that I want to be activated in a series by attaching them all to one 'button' on the work sheet they relate to. That works fine to start with but because the workbook will be opened and then saved with a different name by users, the "Application run ......xls .Sheet13."macroname" approach means an error message about not finding the macro. How do I code this so that the macros can be found whatever the user names the book after opening it. Thanks Sybs |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
application run - macros within macros
Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postFootlockresultsmen" worrkbooks("'isa scoring programme 2007 VBA 1.xls").activate sheets("Sheet9").activate call postFootlockresultsmen() call postthrowresultsmen() call postSpeedclimbresultsmen() when I have multiple subroutine I would do this sub main() call sub1(bob,joe) call sub2(carrol) end sub sub sub1(parm1,parm2) end sub sub sub2(parm1) end sub "SYBS" wrote: Thanks Joel, Sorry to be so thick, how do I phrase it? As in this is what I presently have. Howe do I phrase it correctly? 'THIS IS THE MACRO THAT CALLS THE SUBS TO UPDATE THE RESULTS PAGE' Sub UPDATERESULTSHEET() ActiveSheet.Unprotect ("sybs") Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postFootlockresultsmen" Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postthrowresultsmen" Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postSpeedclimbresultsmen" "Joel" wrote: If all the macro (subroutines) are in one workbook, then just ue the call mysub(parm1,parrm2,...). No workbook references are required. thanks so much for the help appreciated. Sybs "SYBS" wrote: Hi there, I have a number of macros that I want to be activated in a series by attaching them all to one 'button' on the work sheet they relate to. That works fine to start with but because the workbook will be opened and then saved with a different name by users, the "Application run ......xls .Sheet13."macroname" approach means an error message about not finding the macro. How do I code this so that the macros can be found whatever the user names the book after opening it. Thanks Sybs |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
application run - macros within macros
Thanks so much, sorted. Great Regards, Sybs "Joel" wrote: Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postFootlockresultsmen" worrkbooks("'isa scoring programme 2007 VBA 1.xls").activate sheets("Sheet9").activate call postFootlockresultsmen() call postthrowresultsmen() call postSpeedclimbresultsmen() when I have multiple subroutine I would do this sub main() call sub1(bob,joe) call sub2(carrol) end sub sub sub1(parm1,parm2) end sub sub sub2(parm1) end sub "SYBS" wrote: Thanks Joel, Sorry to be so thick, how do I phrase it? As in this is what I presently have. Howe do I phrase it correctly? 'THIS IS THE MACRO THAT CALLS THE SUBS TO UPDATE THE RESULTS PAGE' Sub UPDATERESULTSHEET() ActiveSheet.Unprotect ("sybs") Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postFootlockresultsmen" Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postthrowresultsmen" Sheets("RESULTS").Select Application.Run _ "'isa scoring programme 2007 VBA 1.xls'!Sheet9.postSpeedclimbresultsmen" "Joel" wrote: If all the macro (subroutines) are in one workbook, then just ue the call mysub(parm1,parrm2,...). No workbook references are required. thanks so much for the help appreciated. Sybs "SYBS" wrote: Hi there, I have a number of macros that I want to be activated in a series by attaching them all to one 'button' on the work sheet they relate to. That works fine to start with but because the workbook will be opened and then saved with a different name by users, the "Application run ......xls .Sheet13."macroname" approach means an error message about not finding the macro. How do I code this so that the macros can be found whatever the user names the book after opening it. Thanks Sybs |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to link an application to Macros? | Excel Discussion (Misc queries) | |||
Macros in Personal.xls that would create two toolbars and buttonswith assigned macros | Excel Programming | |||
macros in excel application object | Excel Programming | |||
Application Level macros | Excel Programming | |||
weird saving of a document with macros resulting with macros being transfered to the copy | Excel Programming |