Can't enter break mode at this time

Effexus

New member
Joined
Dec 19, 2019
Messages
3
Reaction score
0
Points
0
Excel Version(s)
2007
Hi.
I'm having issues with deleting a line of code, in my ThisWorkbook Workbook open event. it worked at one time, then suddenly it stopped working. It doesn't give me an error when I run the program, but it just doesn't delete the line of code. When I open the sub and step through it I get the error code "Can't enter break mode at this time." I've checked to make sure the line number was correct & I want to delete only that line.
If I step through the file and get the error... then hit continue or end, it deletes the code like it should... but does not go to "End With"
I tried to input the line "On Error Resume Nest to try to override the error...well that line of code doesn't work on anything that I've tried. (don't know why)
Any help with this issue would be GREATLY appreciated...Jim

I'm cross-posting this from another forum on the 17th 1:00am with no suggestions.
Here is the URL to my original post . Not sure if I did that right...I used the HTML borders...??
https://www.excelforum.com/excel-pr...nter-break-mode-at-this-time.html#post5246337

Here is the code that I'm struggling with
Thanks Jim
Code:
Sub DeleteCodeLines()

Dim wb As Workbook
   
        Set wb = ThisWorkbook
    With wb.VBProject.VBComponents("ThisWorkbook").CodeModule
        .DeleteLines 42, 1
    End With
   
End Sub

Thanks again JIm
 
Last edited by a moderator:

Effexus

New member
Joined
Dec 19, 2019
Messages
3
Reaction score
0
Points
0
Excel Version(s)
2007

AliGW

Administrator
Joined
Nov 8, 2015
Messages
1,800
Reaction score
4
Points
38
Location
Ipswich, Suffolk, England
Excel Version(s)
MS 365 (Beta Insider Channel)
It means that the moderator edited your post to make a link live that was not working before.
 
Top