vba出错时goto无法处理语法错误

时间:2019-12-27 09:33:25

标签: excel vba

我尝试了很多次,发现如果存在语法错误,则无法通过错误处理来处理,我的代码如下:

Option Explicit
Option Compare Text
Sub BRRReport()

    On Error GoTo errBRR

        Dim ColLan, ColLsd As String
        Dim strSheetN As String


check:

    With Sheets(strSheetN)
      'some stuff here
    End With

Done:

    Exit Sub

errBRR:

    ThisWorkbook.Saved = True
    Application.Quit

End Sub

0 个答案:

没有答案