Excel打开VBA编辑器在处理期间打开。 没有产生错误

我在Excel VBA中编写了一个应用程序,当它到达这个函数时,它有时 只是有时会停下来,打开编辑器并突出显示“end Function”之前的最后一行,

Option Explicit Function Get_Special(i_Row, c_Total, v_code As Variant) As Currency Dim c_money As Currency Dim s_Code As String Dim i_Ctr As Integer c_money = 0 If Not IsArrayInitialized(v_code) Then Get_Special = c_money + c_Total Exit Function End If For i_Ctr = LBound(v_code) To UBound(v_code) Select Case v_code(i_Ctr) Case 1 To 10 Case 11 If c_Total = 0 Then c_money = Minimum_Charge(i_Row) Case 12 c_money = c_money + Plug_Fee(i_Row, Range(rngName(RNM.PLUG)).Column) Case Else End Select Next i_Ctr 'VBA editor opens here, highlighted. No error message is given pressing F5 causes it to finish with no problem. Get_Special = c_money End Function 

我很茫然

为了解决以下问题:

IsArrayInitialized函数具有“On Error resume next”error handling,然后检查错误号是否为零,如果不是,则函数返回false。

错误是间歇性的。 我用每次input的不同数据运行代码70次,无法再次重新创build错误。

我加倍检查,没有设置中断点。

debugging – >清除所有debugging点。 debugging – >编译。 然后保存该文件。 有时幻像debugging断点存在。