Workbook Crashes on Print Preview - ComboBox & TextBox

Ottsel

Board Regular
Joined
Jun 4, 2022
Messages
167
Office Version
  1. 365
Platform
  1. Windows
Issue: When I use my Tracker and run the Sub Move_to_List() macro to fill out my list, then try to print (displays the print preview automatically) it causes the booklet to crash and gives me this error message -
1675372603173.png


I put together this sheet to be printed each time its been filled out and used combo boxes and text boxes to make the entering process smoother.

below is what my booklet looks like:
1675372193389.png


when I type in the Tract combobox and hit enter it moves onto the LOT # textbox, and so on. When it reaches the Notes textbox and you press ENTER it'll run this macro:
VBA Code:
Sub Move_to_List()

    If Range("B59") > "" Then
        MsgBox "The sheet is full. Clear it before continuing!", vbOKOnly + vbCritical, "Ottsel's Macro"
        Exit Sub
    Else

    Sheets("WP Tracker").Unprotect

    '...prep
    Application.ScreenUpdating = False
    'Application.AutoCorrect.AutoFillFormulasInLists = False
    Application.DisplayAlerts = False
   
    '...move below
    Sheets("WP Tracker").Range("B5:F5").Copy
    Sheets("WP Tracker").Cells(Rows.Count, 2).End(xlUp).Offset(1).PasteSpecial (xlPasteValues)
    Application.CutCopyMode = False '...it's needed - trust me

    '...Clear combobox(s) & Textbox(s)
    Sheets("WP Tracker").TractCombo.ListIndex = 0
        Range("B5").Value = ""
    Sheets("WP Tracker").LotBox.Text = ""
        Range("C5").Value = ""
    Sheets("WP Tracker").StoryCombo.Text = ""
        Range("D5").Value = ""
    Sheets("WP Tracker").CompleteBox.Text = ""
        Range("E4").Value = ""
    Sheets("WP Tracker").NoteBox.Text = ""
        Range("F5").Value = ""
   
    '...Setup for next input
    Application.CutCopyMode = False
    Sheets("WP Tracker").Cells(Rows.Count, 2).End(xlUp).Select
    Application.ScreenUpdating = True
    'Application.AutoCorrect.AutoFillFormulasInLists = True
    Application.DisplayAlerts = True
    Sheets("WP Tracker").Protect
    End If

End Sub

If anyone sees something that would cause the crash to occur on a "print preview" it would help me a ton to know for future projects.
Currently I just made a print macro in the upper right hand corner to bypass this crash, but it would be terrible if I forget and hit Ctrl + P

Probably overkilling it with this information, as I can't see it causing an issue, but perhaps your eyes sees something mine cannot.
On the worksheet I have the comboboxes and textboxes coded with these private subs:
VBA Code:
Option Explicit

Private Sub TractCombo_change()

    TractCombo.Text = UCase(TractCombo.Text)

End Sub
Private Sub TractCombo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
   
    If KeyCode = 13 Then
        LotBox.Activate
    End If

End Sub
Private Sub LotBox_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
   
    If KeyCode = 13 Then
        StoryCombo.Activate
    End If

End Sub
Private Sub StoryCombo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)

    If KeyCode = 13 Then
        CompleteBox.Activate
    End If

End Sub
Private Sub CompleteBox_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
   
    If KeyCode = 13 Then
        NoteBox.Activate
    End If
   
End Sub
Private Sub Notebox_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
   
    If KeyCode = 13 Then
        Call Move_to_List
        TractCombo.Activate
    End If
   
End Sub

Thank you for taking to the time to help me with this issue.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,215,136
Messages
6,123,251
Members
449,093
Latest member
Vincent Khandagale

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top