3

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 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.

Vityata
  • 42,633
  • 8
  • 55
  • 100
JMichael
  • 569
  • 11
  • 28
  • How does the code break? Does it open the VBA window and highlight the line in yellow? Or do you see the continue/debug window? – David Rushton Oct 31 '16 at 13:37
  • It's possible the suggested fix worked. The code was not throwing the break prompt, simply stopping & highlighting the code as if you had already hit Debug. I went ahead & had my user use Ctrl+Break twice anyway and the code is running thus far, but that section of code is hit at least a dozen times so there's still time for things to go off the rails. If the execution finishes I'll accept the answer. – JMichael Oct 31 '16 at 15:13

1 Answers1

11

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

  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..
jainashish
  • 4,702
  • 5
  • 37
  • 48
Vityata
  • 42,633
  • 8
  • 55
  • 100