G
Greg
NT - XL97
-----------------------------------------------------------
Hi,
I have the following printing userform command button code
that runs fine in 97 but apparently produces a run-time
(paper size property) error in XP.
I don't have XP here so could someone help me adapt it so
would work for both versions?
Here is my code, ob stands for option button.
Code:
***********************************
Private Sub OKButton_Click()
Dim i As Integer
Application.ScreenUpdating = False
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
With Sheets(ListBox1.List(i))
If obPaperLetter Then .PageSetup.PaperSize
= xlPaperLetter
If obPaperLegal Then .PageSetup.PaperSize
= xlPaperLegal
If obPaperA4 Then .PageSetup.PaperSize =
xlPaperA4
.PrintOut
End With
End If
Next i
Application.ScreenUpdating = True
Unload Me
End Sub
***********************************************
Thanks a lot!
Greg
-----------------------------------------------------------
Hi,
I have the following printing userform command button code
that runs fine in 97 but apparently produces a run-time
(paper size property) error in XP.
I don't have XP here so could someone help me adapt it so
would work for both versions?
Here is my code, ob stands for option button.
Code:
***********************************
Private Sub OKButton_Click()
Dim i As Integer
Application.ScreenUpdating = False
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
With Sheets(ListBox1.List(i))
If obPaperLetter Then .PageSetup.PaperSize
= xlPaperLetter
If obPaperLegal Then .PageSetup.PaperSize
= xlPaperLegal
If obPaperA4 Then .PageSetup.PaperSize =
xlPaperA4
.PrintOut
End With
End If
Next i
Application.ScreenUpdating = True
Unload Me
End Sub
***********************************************
Thanks a lot!
Greg