I have a custom printform with macros that I use do the printing for my workbook. The problem is that the printer sometimes jams. I thought it was the printer so I tryed another that was the same printer and it had the same problem. I then disabeled the printform and set my print area and printed that way and everything was fine. I then went back to the printform and it was fine.
Does this sound like a problem with my code or the printer.
(I don't see how my code could cause this)
the printer is a NEC 870
and heres some of my code it has some named ranges in it.
Thanks for any help you may provide
steve w
Private Static Sub PrintAll()
Dim count As Integer
Dim PlanCount As Integer
Dim PlanIndex As Single
Dim DPage1 As Variant
Dim DPage2 As Variant
Dim BPages1 As Variant
Dim BPage2 As Variant
Dim i As Integer
Dim p As Integer
DPage1 = Array("DPLAN_BLINDS1", "DPLAN_SHADES1", "DPLAN_SHUTTERS1", "DPLAN_DRAPES1", "DPLAN_VALANCE1")
DPage2 = Array("DPLAN_BLINDS2", "DPLAN_SHADES2", "DPLAN_SHUTTERS2", "DPLAN_DRAPES2", "DPLAN_VALANCE2")
BPage1 = Array("BPLAN_BLINDS1", "BPLAN_SHADES1", "BPLAN_SHUTTERS1", "BPLAN_DRAPES1", "BPLAN_VALANCE1")
BPage2 = Array("BPLAN_BLINDS2", "BPLAN_SHADES2", "BPLAN_SHUTTERS2", "BPLAN_DRAPES2", "BPLAN_VALANCE2")
PlanCount = cboPlans.ListCount - 1
check1 = Array(CheckBox2.Value, CheckBox3.Value, CheckBox4.Value, CheckBox5.Value, CheckBox6.Value)
For PlanIndex = 0 To PlanCount
cboPlans.ListIndex = PlanIndex
Form_Refresh
If chkDesign.Value = True Then
For i = 0 To 4
If check1(i) = True And (OptionButton1.Value = True Or OptionButton3.Value = True) Then
Range(DPage1(i)).PrintOut
End If
If check1(i) = True And (OptionButton2.Value = True Or OptionButton3.Value = True) Then
Range(DPage2(i)).PrintOut
End If
Next
End If
If chkBuilder.Value = True Then
For i = 0 To 4
If check1(i) = True And (OptionButton1.Value = True Or OptionButton3.Value = True) Then
Range(BPage1(i)).PrintOut
End If
If check1(i) = True And (OptionButton2.Value = True Or OptionButton3.Value = True) Then
Range(BPage2(i)).PrintOut
End If
Next
End If
Next
End Sub
Does this sound like a problem with my code or the printer.
(I don't see how my code could cause this)
the printer is a NEC 870
and heres some of my code it has some named ranges in it.
Thanks for any help you may provide
steve w
Private Static Sub PrintAll()
Dim count As Integer
Dim PlanCount As Integer
Dim PlanIndex As Single
Dim DPage1 As Variant
Dim DPage2 As Variant
Dim BPages1 As Variant
Dim BPage2 As Variant
Dim i As Integer
Dim p As Integer
DPage1 = Array("DPLAN_BLINDS1", "DPLAN_SHADES1", "DPLAN_SHUTTERS1", "DPLAN_DRAPES1", "DPLAN_VALANCE1")
DPage2 = Array("DPLAN_BLINDS2", "DPLAN_SHADES2", "DPLAN_SHUTTERS2", "DPLAN_DRAPES2", "DPLAN_VALANCE2")
BPage1 = Array("BPLAN_BLINDS1", "BPLAN_SHADES1", "BPLAN_SHUTTERS1", "BPLAN_DRAPES1", "BPLAN_VALANCE1")
BPage2 = Array("BPLAN_BLINDS2", "BPLAN_SHADES2", "BPLAN_SHUTTERS2", "BPLAN_DRAPES2", "BPLAN_VALANCE2")
PlanCount = cboPlans.ListCount - 1
check1 = Array(CheckBox2.Value, CheckBox3.Value, CheckBox4.Value, CheckBox5.Value, CheckBox6.Value)
For PlanIndex = 0 To PlanCount
cboPlans.ListIndex = PlanIndex
Form_Refresh
If chkDesign.Value = True Then
For i = 0 To 4
If check1(i) = True And (OptionButton1.Value = True Or OptionButton3.Value = True) Then
Range(DPage1(i)).PrintOut
End If
If check1(i) = True And (OptionButton2.Value = True Or OptionButton3.Value = True) Then
Range(DPage2(i)).PrintOut
End If
Next
End If
If chkBuilder.Value = True Then
For i = 0 To 4
If check1(i) = True And (OptionButton1.Value = True Or OptionButton3.Value = True) Then
Range(BPage1(i)).PrintOut
End If
If check1(i) = True And (OptionButton2.Value = True Or OptionButton3.Value = True) Then
Range(BPage2(i)).PrintOut
End If
Next
End If
Next
End Sub