vba mysql 自动化错误_自动化错误 - 灾难性故障EXCEL VBA

我有一个工作簿,在打开时抛出此错误 . 当它打开VBA模块时,当前行是sub的定义 . 但唯一的选择是杀死整个Excel进程 .

我有自定义文档属性,我有嵌入式组合框控件,我不知道它可能是什么,Excel没有帮助 .

但是,当我在另一台计算机上打开相同的文件时 - 它不会抛出错误 .

有没有人有这种错误的经验或建议?

这是Open代码,但发生错误时,'Show Next Statement'命令不会指向此处:

```java

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

```


版权声明:本文为weixin_30058099原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。