没有断点的宏停止

JMi*_*ael 0 excel vba excel-vba

我开发了一个在我的计算机上正常运行的宏.但是当我有预期的最终用户在他们的计算机上运行宏时,即使没有断点,它也会在同一行代码中断开.相关代码如下:

Function MMFProcessor(Source_Folder_Str As String, Input_File_Name As String, Output_Sheet As Worksheet, NPU As String, Prods As String, sw As StatWin, _
    Processed_Members_Str As String, MbrRow_Dict() As String, FlgMeas() As String, Output_Sheet_Row As Long, Output_Mbr_Key_Col As String, Output_Name As String, _
    Optional Ambetter As Boolean = False) As Variant()
'
Dim Source_WB As Workbook
Set Source_WB = Workbooks.Open(Source_Folder_Str & "\" & Input_File_Name & ".xlsx", , True)
Dim Input_Mbr_Key_Col As String
Dim Input_Product_Col As String
Dim Input_SubMsr_Col As String
Dim ret As Boolean
ret = True
Dim Return_Array(4) As Variant
Dim Found As Boolean
Dim Source_Col_Nbr As Integer
Dim NumerCnt_Col As String
Dim SourceFile_Col_Cnt As Long
SourceFile_Col_Cnt = Count_Columns(Source_WB.Worksheets(1))
Dim Col_Str As String

'Set/Reset sw.Input_Sorted
sw.Input_Sorted = False '*****THIS IS THE LINE THAT CATCHES*********

If sw.Detailed_Log Then
    Call Update("Starting MMFProcessor. Inputs: Source_Folder_Str= " & Source_Folder_Str & "; Input_File_Name= '" & Input_File_Name & "'; Output_Sheet= '" & Output_Sheet.Name & _
        "'; Output_Sheet_Row= '" & Output_Sheet_Row & "'; Mbr_Key_Col= '" & Output_Mbr_Key_Col & "'; Output_Name= '" & Output_Name & "'", 0, sw)
End If
Run Code Online (Sandbox Code Playgroud)

Stat_Win是一个自定义表单,我把它放在一起作为宏的状态窗口.该Input_Sorted变量确实存在,是一个布尔值.运行宏的另一个人具有相同版本的Excel,对正在使用的文件夹的访问权限,并且在我能想到的任何方面基本相同.

任何关于系统设置中的非显而易见的差异的任何帮助或代码可能捕获的任何其他原因,我没有提到将非常感激.

Vit*_*ata 6

这听起来像一个鬼怪.这是那些解决方案:

  1. 按弹出窗口中的"调试"按钮.
  2. Ctrl+ Pause|Break两次.
  3. 点击播放按钮继续.
  4. 完成后保存文件..