How do I suppress Printing status?

  • Thread starter Thread starter LowellSpecht
  • Start date Start date
L

LowellSpecht

How do I suppress the printing status dialog?

I am using the following,

ActiveWorkbook.Charts(ChartSheetData(i + 1)).PrintOut Copies:=1,
Collate:=True

in a For loop to print 80 chart sheets (user can select from 1 to 80
charts to print). The problem is each time this statement is executed
in the For loop it displays the "Printing sheet 1 of 1" message. For
80 charts it is an annoying flicker that a) slows down the application
and b) looks bad. I've tried setting Application.DisplayAlerts to
false just prior to the above statement but it doesn't have any affect.


I apologize if this has been addressed in this forum previously but I'm
new to this forum so please forgive me.

Oh, I'm using Excel for XP on a windows 2k professional OS.
 
Thanks for the response, Dave.

However, that won’t fix my problem. I’ve included my code below for
the printing and Application.ScreenUpdating is working fine. My
workbook is frozen on the screen while this function is running. I use
a custom progress indicator to indicate the % complete of charts
printed and that too works fine (except for the flickering I mentioned
in my first post). I want the progress indicator to update during the
execution of the code below. If I use the API call then I suspect the
Progress Indicator will be frozen too which I don’t want.

Any other ideas?



PHP code:
--------------------

Sub PrintTheCharts()
Dim i As Integer, bSelected As Boolean
Dim PctDone

Application.DisplayAlerts = False
bSelected = False
Application.ScreenUpdating = False
biequal0 = True
PctDone = 0 / (ListBoxChartsToBePrinted.ListCount - 1)
Call UpdateFormProgress(PctDone)
For i = 0 To ListBoxChartsToBePrinted.ListCount - 1
If i > 0 Then biequal0 = False
If ListBoxChartsToBePrinted.Selected(i) Then
If ListBoxChartsToBePrinted.Selected(i) Then
If Not Application.ThisWorkbook.AbortPrint Then
ActiveWorkbook.Charts(ChartSheetData(i + 1)).PrintOut Copies:=1, Collate:=True
If Err.Number <> 0 Then
WriteWarning "error printing chart " & ChartSheetData(i + 1)
Err.Clear ' Clear Err object properties.
End If
End If
bSelected = True
End If
End If
PctDone = i / (ListBoxChartsToBePrinted.ListCount - 1)
Call UpdateFormProgress(PctDone)
Next i
Unload UserForm11
UserForm7.Repaint
Application.ThisWorkbook.AbortPrint = False
If Not bSelected Then
MsgBox "You have not selected any charts to be printed.", vbInformation, "Information"
End If
Application.ScreenUpdating = True
Application.DisplayAlerts = True

End Sub

--------------------
 
Untested.

Can you use the API calls to freeze the display and every so often turn it back
to normal. Then show your userform and then call the API to freeze the screen
again.

==
Or maybe lower(?) your standards: Put a userform up that says this will take a
little while, hide everything and come back when it's done.

If you test the first, make sure you save your work before running the code. If
you have to reboot, you'll be happier with your saved work.
 
Back
Top