XL5NT: Can't Print Multiple Copies of a Document in Windows 95ID: Q136085
|
In Microsoft Windows 95, when you attempt to print multiple copies of a document in Microsoft Excel version 5.0 for Windows NT, only one copy of the document is printed.
This problem occurs because Microsoft Excel for Windows NT does not correctly use the Microsoft Windows 95 API that controls the number of copies that are printed during each print job.
Method 1: To work around this problem, use the following Visual Basic for applications code to print multiple copies. Microsoft provides examples of Visual Basic for applications procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.
'A procedure to print multiple copies
Sub Example()
On Error GoTo PrintEmbeddedChart
' Dimension variables
Dim Ncopies As Integer, Counter As Integer
Ncopies = _
Application.InputBox _
("Please enter number of copies to print: ", _
"Print Multiple Copies", 1, , , , , 1)
For Counter = 1 To Ncopies
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Next
Exit Sub
'Error handler to print embedded charts PrintEmbeddedChart:
For Counter = 1 To Ncopies
ActiveChart.PrintOut Copies:=1
Next
End Sub
There are only two API calls to print more than one copy from the printer in Microsoft Windows 95. An application written specifically to run under Microsoft Windows NT doesn't use either of these API calls. This functionality does work if you are using Microsoft Windows NT.
Additional query words: xlnt
Keywords :
Version : 5.00
Platform : WINDOWS
Issue type :
Last Reviewed: July 14, 1999