I have a book that throws this error on opening. When this happens and I open the VBA module, the current line is the definition under. But the only option is to kill the whole Excel process.
I have custom document properties, I have built-in controls with a list, I have no idea what it can be, and Excel does not help.
However, when I open the same file on another computer, it does not give an error.
Does anyone have experience or advice with such a mistake?
Here's the Open code, but the Show Next Expression command here does not indicate when an error occurs:
`` ``
Private Sub Workbook_Open() Dim ans If Range("currentstatus") Like "*Ready for Year-End Preparation*" Then ans = MsgBox("This workbook is ready for Year-End Preparation" & vbCrLf & "Would you like to begin?", vbYesNo) If ans = vbYes Then Range("Phase") = "Year-End" SheetsSet 3 End If End If 'Exit Sub If Range("Phase") = "Commissions" Then If Range("currentstatus") Like "*RVP/Dept Head Approved*" Then ans = MsgBox("Commissions have been approved for " & Range("applicablemonth") & vbCrLf & "Would you like to enter data for the new period?", vbYesNo + vbQuestion) If ans = vbYes Then Range("ApplicableMonth") = Format(DateAdd("m", 1, CVDate(Range("applicablemonth"))), "YYYY-MM") Range("CurrentStatus") = "Ready for Data Entry for " & Range("ApplicableMonth") ' now reset the summary page Prot False, "Commission Form Summary" Range("SalesPersonComplete") = Range("Summary") Range("RVPComplete") = "" Range("BrMgrComplete") = "" Prot True, "Commission Form Summary" Sheets("Menu").Select ' MsgBox "Begin." End If End If End If End Sub
vba excel-vba excel
George W Aug 08 '15 at 1:59 2015-08-08 01:59
source share