Ottsel
Board Regular
- Joined
- Jun 4, 2022
- Messages
- 174
- Office Version
- 365
- Platform
- 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 -
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:
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:
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:
Thank you for taking to the time to help me with this issue.
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:
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.