![]() |
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 |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 06:18 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com