Code stops, VBA editor opens automatically...

wpryan

Well-known Member
Joined
May 26, 2009
Messages
534
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have some code running on my computer that is operating fine, but on another guy's computer, it gets hung up. on the Worksheet Change, I have this code (partial):
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Application.ScreenUpdating = False
[COLOR=#000000]Application.EnableEvents = False[/COLOR]

If Range("D2") = "Free Flap / small Flap" Then
    With ActiveSheet
        lRow = .Cells(.Rows.Count, "F").End(xlUp).Row
    End With
    Range("F2:F" & lRow).ClearContents
    Application.Range("fFlap").Copy _
    Destination:=Worksheets("Mainpage").Range("F2")
    With ActiveSheet
        lRow = .Cells(.Rows.Count, "F").End(xlUp).Row
    End With
    Range("F2:F" & lRow).Select
        With Selection.Interior
            .Pattern = xlNone
            .TintAndShade = 0
            .PatternTintAndShade = 0
        End With
    Columns("F").AutoFit
    Range("F2").Select
End If

...etc
As stated above, it runs fine on my computer. However, on another computer when cell D2 is changed, the VBA editor opens automatically with the code stopped on the Application.EnableEvents line (highlighted yellow in the editor). He has to hit the run button to get it to complete.

...any ideas?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
I think this is a bug in VB Environment. I get VBE stops (where none exist) on lines of code in Microsoft Access too. That person must press F5 to continue.
VB thinks there is a stop point. THERE'S NOT!

I sometimes correct it in Access by compacting the database, but have no idea how this can be done in Excel.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top