Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to link an application to Macros? kishore Excel Discussion (Misc queries) 0 December 27th 07 09:14 AM
Macros in Personal.xls that would create two toolbars and buttonswith assigned macros Brian Day Excel Programming 1 March 29th 07 11:20 PM
macros in excel application object josef123 Excel Programming 3 October 18th 06 12:44 PM
Application Level macros modjoe23[_3_] Excel Programming 7 August 24th 05 03:14 PM
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM


All times are GMT +1. The time now is 03:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"