没有断点的宏停止 [英] Macro stopping without breakpoint

查看:87
本文介绍了没有断点的宏停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I developed a macro that is running fine on my computer. But when I have the intended end user run the macro on their computer it keeps breaking at the same line of code even though there's no breakpoint. The relevant code is below:

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

Stat_Win是我自定义的一种形式,用作宏的状态窗口. Input_Sorted变量确实存在,并且是布尔值.运行该宏的其他人具有相同版本的Excel,对正在使用的文件夹具有访问权限,并且在我能想到的任何方面都基本相同.

Stat_Win is a custom form that I put together to serve as a status window for the macro. The Input_Sorted variable does exist and is a Boolean. The other person running the macro has the same version of Excel, access rights to the folders being used, and is basically the same in any respect that I can think of.

任何对系统设置非明显差异的帮助,或者我可能未提及的任何其他可能捕获代码的原因,都将受到帮助.

Any help on non-obvious differences in system setup or any other reason the code might be catching that I haven't mentioned would be much appreciated.

推荐答案

It sounds like a ghostbreak. This is the solution for those:

  1. 在弹出窗口中按调试"按钮.
  2. Ctrl + 暂停|中断两次.
  3. 点击播放按钮以继续.
  4. 完成后保存文件.
  1. Press "Debug" button in the popup.
  2. Press Ctrl+Pause|Break twice.
  3. Hit the play button to continue.
  4. Save the file after completion..

这篇关于没有断点的宏停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆