#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Call Macro

I have a number of macros in one macro on in Personal.xls

The first one works and then stops. I didn't put all the code here just the
last two lines of the first macro and the first line of the second one. Any
reason it stops after the first macro???

Call Print68005xChart
End Sub
_______________________
Sub Print68005xChart()

Thanks
Frank
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Call Macro

Hi,

You don't need to use Call but using it won't give the problem you describe
and there is nothing wrong with the 2 code snippets you have provided. Just
one other possibility, are you sure it's failing to call the second sub? It
could just be that the second sub is doing nothing i.e. not doing what you
expect.

Put a line in the second sub you are 100% sure will work

msgbox("In sub 2")

and see if the message box comes up.

Mike

"Beep Beep" wrote:

I have a number of macros in one macro on in Personal.xls

The first one works and then stops. I didn't put all the code here just the
last two lines of the first macro and the first line of the second one. Any
reason it stops after the first macro???

Call Print68005xChart
End Sub
_______________________
Sub Print68005xChart()

Thanks
Frank

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Call Macro

Thanks Mike:

Yes I got it to work, however I have a new situation. There are 12 macros
in this one and they each print out a chart from a different file, however It
will work just fine if I "Step" through the macro while in ALT F11. However
if I try to run it using the assinged control key it will stop after just the
first one.

Here is the code for one of them.

Workbooks.Open Filename:= _
"C:\Documents and Settings\t_frankb\My Documents\Excel\Weekly
Stability Metrics\Weekly Stability Metrics
Reports\06182007\Charts\Weekly_Stability_Metrics_6 500_6.6_6_18_07.xls"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.Close
Call Print68005xChart
End Sub

Thanks
Frank

"Mike H" wrote:

Hi,

You don't need to use Call but using it won't give the problem you describe
and there is nothing wrong with the 2 code snippets you have provided. Just
one other possibility, are you sure it's failing to call the second sub? It
could just be that the second sub is doing nothing i.e. not doing what you
expect.

Put a line in the second sub you are 100% sure will work

msgbox("In sub 2")

and see if the message box comes up.

Mike

"Beep Beep" wrote:

I have a number of macros in one macro on in Personal.xls

The first one works and then stops. I didn't put all the code here just the
last two lines of the first macro and the first line of the second one. Any
reason it stops after the first macro???

Call Print68005xChart
End Sub
_______________________
Sub Print68005xChart()

Thanks
Frank

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Call Macro

Does the control key combination include a Shift such at Ctrl+B
(ctrl+shift+b)

if so, try changing it to a lower case letter.

--
Regards,
Tom Ogilvy


"Beep Beep" wrote:

Thanks Mike:

Yes I got it to work, however I have a new situation. There are 12 macros
in this one and they each print out a chart from a different file, however It
will work just fine if I "Step" through the macro while in ALT F11. However
if I try to run it using the assinged control key it will stop after just the
first one.

Here is the code for one of them.

Workbooks.Open Filename:= _
"C:\Documents and Settings\t_frankb\My Documents\Excel\Weekly
Stability Metrics\Weekly Stability Metrics
Reports\06182007\Charts\Weekly_Stability_Metrics_6 500_6.6_6_18_07.xls"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.Close
Call Print68005xChart
End Sub

Thanks
Frank

"Mike H" wrote:

Hi,

You don't need to use Call but using it won't give the problem you describe
and there is nothing wrong with the 2 code snippets you have provided. Just
one other possibility, are you sure it's failing to call the second sub? It
could just be that the second sub is doing nothing i.e. not doing what you
expect.

Put a line in the second sub you are 100% sure will work

msgbox("In sub 2")

and see if the message box comes up.

Mike

"Beep Beep" wrote:

I have a number of macros in one macro on in Personal.xls

The first one works and then stops. I didn't put all the code here just the
last two lines of the first macro and the first line of the second one. Any
reason it stops after the first macro???

Call Print68005xChart
End Sub
_______________________
Sub Print68005xChart()

Thanks
Frank

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Call Macro

Hi Tom:

The reason I selected Ctrl-Shirt-P is because I was under the impression
that you could not assigne a key if that key was allready taken, i.e. Ctrl-P
= Print Command. If I try to change the Ctrl-Shirt-P to lower case it doesn't
let me????

Thanks
Frank


"Tom Ogilvy" wrote:

Does the control key combination include a Shift such at Ctrl+B
(ctrl+shift+b)

if so, try changing it to a lower case letter.

--
Regards,
Tom Ogilvy


"Beep Beep" wrote:

Thanks Mike:

Yes I got it to work, however I have a new situation. There are 12 macros
in this one and they each print out a chart from a different file, however It
will work just fine if I "Step" through the macro while in ALT F11. However
if I try to run it using the assinged control key it will stop after just the
first one.

Here is the code for one of them.

Workbooks.Open Filename:= _
"C:\Documents and Settings\t_frankb\My Documents\Excel\Weekly
Stability Metrics\Weekly Stability Metrics
Reports\06182007\Charts\Weekly_Stability_Metrics_6 500_6.6_6_18_07.xls"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.Close
Call Print68005xChart
End Sub

Thanks
Frank

"Mike H" wrote:

Hi,

You don't need to use Call but using it won't give the problem you describe
and there is nothing wrong with the 2 code snippets you have provided. Just
one other possibility, are you sure it's failing to call the second sub? It
could just be that the second sub is doing nothing i.e. not doing what you
expect.

Put a line in the second sub you are 100% sure will work

msgbox("In sub 2")

and see if the message box comes up.

Mike

"Beep Beep" wrote:

I have a number of macros in one macro on in Personal.xls

The first one works and then stops. I didn't put all the code here just the
last two lines of the first macro and the first line of the second one. Any
reason it stops after the first macro???

Call Print68005xChart
End Sub
_______________________
Sub Print68005xChart()

Thanks
Frank



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Call Macro

Are you doing it in
Tools=Macro=Macros, select your macro and click options?

To the best of my knowledge, you can replace a predefined shortcut with your
own macro.

--
Regards,
Tom Ogilvy


"Beep Beep" wrote:

Hi Tom:

The reason I selected Ctrl-Shirt-P is because I was under the impression
that you could not assigne a key if that key was allready taken, i.e. Ctrl-P
= Print Command. If I try to change the Ctrl-Shirt-P to lower case it doesn't
let me????

Thanks
Frank


"Tom Ogilvy" wrote:

Does the control key combination include a Shift such at Ctrl+B
(ctrl+shift+b)

if so, try changing it to a lower case letter.

--
Regards,
Tom Ogilvy


"Beep Beep" wrote:

Thanks Mike:

Yes I got it to work, however I have a new situation. There are 12 macros
in this one and they each print out a chart from a different file, however It
will work just fine if I "Step" through the macro while in ALT F11. However
if I try to run it using the assinged control key it will stop after just the
first one.

Here is the code for one of them.

Workbooks.Open Filename:= _
"C:\Documents and Settings\t_frankb\My Documents\Excel\Weekly
Stability Metrics\Weekly Stability Metrics
Reports\06182007\Charts\Weekly_Stability_Metrics_6 500_6.6_6_18_07.xls"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.Close
Call Print68005xChart
End Sub

Thanks
Frank

"Mike H" wrote:

Hi,

You don't need to use Call but using it won't give the problem you describe
and there is nothing wrong with the 2 code snippets you have provided. Just
one other possibility, are you sure it's failing to call the second sub? It
could just be that the second sub is doing nothing i.e. not doing what you
expect.

Put a line in the second sub you are 100% sure will work

msgbox("In sub 2")

and see if the message box comes up.

Mike

"Beep Beep" wrote:

I have a number of macros in one macro on in Personal.xls

The first one works and then stops. I didn't put all the code here just the
last two lines of the first macro and the first line of the second one. Any
reason it stops after the first macro???

Call Print68005xChart
End Sub
_______________________
Sub Print68005xChart()

Thanks
Frank

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 can run a macro ( call a macro) on selection of any filtercriteria? [email protected] Excel Worksheet Functions 7 February 20th 09 12:34 AM
Call an Access macro from an Excel macro Jason W Excel Discussion (Misc queries) 1 May 1st 08 08:33 PM
Excel Macro call Word Macro with Parameters Bill Sturdevant[_2_] Excel Programming 9 May 24th 07 12:21 AM
call another macro dspilberg Excel Programming 8 April 26th 07 04:54 PM
Call macro stored in Excel workbook from Outlook's macro Gvaram Excel Programming 0 October 4th 06 05:47 PM


All times are GMT +1. The time now is 10:50 AM.

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

About Us

"It's about Microsoft Excel"