Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a pause in my macro before printing
I have a macro that basically refreshes several queries & performs some other
basic task. I need to add code that will then print a final report (which is just printing one of the tabs). The problem I'm having is that when I add a pause, it seems to pause the refreshing process then it ends up printing before all of the refreshes are complete. Any suggestions, I'm very new to VBA so I'm sure this is an easy fix that I'm overlooking. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a pause in my macro before printing
As always post YOUR code for comments. Could be
application.enableevents=false code application.enableevents=true -- Don Guillett Microsoft MVP Excel SalesAid Software "Chas" wrote in message ... I have a macro that basically refreshes several queries & performs some other basic task. I need to add code that will then print a final report (which is just printing one of the tabs). The problem I'm having is that when I add a pause, it seems to pause the refreshing process then it ends up printing before all of the refreshes are complete. Any suggestions, I'm very new to VBA so I'm sure this is an easy fix that I'm overlooking. Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a pause in my macro before printing
Sorry I forgot to add the code currently being used
ActiveWorkbook.RefreshAll Sheets("JOB COST SUMMARY").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Again, the problem is that it prints before the refresh in complete, I want it to print when the refresh is done. Thanks Again "Chas" wrote: I have a macro that basically refreshes several queries & performs some other basic task. I need to add code that will then print a final report (which is just printing one of the tabs). The problem I'm having is that when I add a pause, it seems to pause the refreshing process then it ends up printing before all of the refreshes are complete. Any suggestions, I'm very new to VBA so I'm sure this is an easy fix that I'm overlooking. Thanks |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a pause in my macro before printing
Still having the same trouble. It prints, then finishes the refresh &
calculations. Thanks for taking to time. "Don Guillett" wrote: As always post YOUR code for comments. Could be application.enableevents=false code application.enableevents=true -- Don Guillett Microsoft MVP Excel SalesAid Software "Chas" wrote in message ... I have a macro that basically refreshes several queries & performs some other basic task. I need to add code that will then print a final report (which is just printing one of the tabs). The problem I'm having is that when I add a pause, it seems to pause the refreshing process then it ends up printing before all of the refreshes are complete. Any suggestions, I'm very new to VBA so I'm sure this is an easy fix that I'm overlooking. Thanks |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a pause in my macro before printing
Thanks Don, but still no luck. Do you think it's because there's multiple
queries on different sheets? The way it looks now, there is a slight pause before the printing but then it goes to on to refresh & calculate (you can see the status in bottom left corner), it appears that it refreshes the first tab (Job Cost Summary), then prints that tab, then refreshes & recalculates the remaining sheets which doesn't work because all the other sheets are summarized on the first tab (Job Cost Summary). I've also tried your code with a "Wait" before the printing, and no luck. Any other suggestions are greatly appreciated and I really appreciate the help you've already given. Thanks "Don Guillett" wrote: try this or have your query .Refresh BackgroundQuery:=False application.enableevents=false ActiveWorkbook.RefreshAll application.enableevents=true Sheets("JOB COST SUMMARY").PrintOut -- Don Guillett Microsoft MVP Excel SalesAid Software "Chas" wrote in message ... Sorry I forgot to add the code currently being used ActiveWorkbook.RefreshAll Sheets("JOB COST SUMMARY").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Again, the problem is that it prints before the refresh in complete, I want it to print when the refresh is done. Thanks Again "Chas" wrote: I have a macro that basically refreshes several queries & performs some other basic task. I need to add code that will then print a final report (which is just printing one of the tabs). The problem I'm having is that when I add a pause, it seems to pause the refreshing process then it ends up printing before all of the refreshes are complete. Any suggestions, I'm very new to VBA so I'm sure this is an easy fix that I'm overlooking. Thanks |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a pause in my macro before printing
If desired, send your file to my address below along with this msg and
a clear explanation of what you want and before/after examples. -- Don Guillett Microsoft MVP Excel SalesAid Software "Chas" wrote in message ... Thanks Don, but still no luck. Do you think it's because there's multiple queries on different sheets? The way it looks now, there is a slight pause before the printing but then it goes to on to refresh & calculate (you can see the status in bottom left corner), it appears that it refreshes the first tab (Job Cost Summary), then prints that tab, then refreshes & recalculates the remaining sheets which doesn't work because all the other sheets are summarized on the first tab (Job Cost Summary). I've also tried your code with a "Wait" before the printing, and no luck. Any other suggestions are greatly appreciated and I really appreciate the help you've already given. Thanks "Don Guillett" wrote: try this or have your query .Refresh BackgroundQuery:=False application.enableevents=false ActiveWorkbook.RefreshAll application.enableevents=true Sheets("JOB COST SUMMARY").PrintOut -- Don Guillett Microsoft MVP Excel SalesAid Software "Chas" wrote in message ... Sorry I forgot to add the code currently being used ActiveWorkbook.RefreshAll Sheets("JOB COST SUMMARY").Select ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True Again, the problem is that it prints before the refresh in complete, I want it to print when the refresh is done. Thanks Again "Chas" wrote: I have a macro that basically refreshes several queries & performs some other basic task. I need to add code that will then print a final report (which is just printing one of the tabs). The problem I'm having is that when I add a pause, it seems to pause the refreshing process then it ends up printing before all of the refreshes are complete. Any suggestions, I'm very new to VBA so I'm sure this is an easy fix that I'm overlooking. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pause between copies of Excel sheets while printing | Excel Discussion (Misc queries) | |||
Stop / Pause a Macro using Pause button | Excel Programming | |||
Pause Printing in VBA | Excel Programming | |||
pause macro to make changes before printing. | Excel Programming | |||
Pause macro | Excel Programming |