Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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
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
Pause between copies of Excel sheets while printing waybomb Excel Discussion (Misc queries) 1 August 8th 08 04:50 PM
Stop / Pause a Macro using Pause button scott56hannah Excel Programming 0 June 27th 08 12:48 PM
Pause Printing in VBA Vijay Chary Excel Programming 2 March 30th 08 10:48 AM
pause macro to make changes before printing. Baffee Excel Programming 4 May 30th 06 02:18 PM
Pause macro Bill Barclift Excel Programming 0 September 30th 03 09:22 PM


All times are GMT +1. The time now is 04:51 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"