Automation Error - EXCEL VBA Crash

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 
+2
vba excel-vba excel
Aug 08 '15 at 1:59
source share
2 answers

I had this message earlier today, and this is due to the fact that another Excel instance was opened as a background process (the background process previously opened this file, so it had to do something with it). When I closed another instance, the problem disappeared.

It might be worth checking out Task Manager> Background Processes to make sure this is the case.

+2
Mar 22 '16 at 20:32
source share

Double check the file extension. Excel spreadsheets with built-in macros require * .xlsm extension, not * .xls.

The final answer is โ€œfor mannequins,โ€ but I made this mistake myself.

-one
Jun 20 '17 at 18:34
source share



All Articles