VBA Error window has changed - no more Debug button

mcomp72

Active Member
Joined
Aug 14, 2016
Messages
308
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I'm not sure how or when this happened, but the look of the VBA error windows I receive has changed. I've created an image to show you what they looked like before, and what they look like now.

VBA-Error-change.png

This is a big problem, because when my code has an error, I can no longer use the Debug button to take me to the line where the error occurred.

I have been working on my Macro-Enabled workbook for several months now, and it did not use to do this. I have no idea what I did to change the way the errors look. As a test, I tried a new workbook, and the error on that one looks the way it should (like the BEFORE image), so it doesn't seem to be a change in Excel itself.

I also tried my workbook on another computer, and the same problem occurred. So I'm guessing there is something in my code that is causing this? I have no idea what it might be. Anyone have any ideas?
 
I searched my entire project for "vbMsgBoxHelpButton" but it was not found. So there does not appear to be any code in my file similar to what you've posted.
I meant that there is no X-button (to close) in internal error message of VBE, but it is in MsgBox.
Some AddIns (Excel's or COM) can produce such a message box.
Try temporary disabling all installed AddIns
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
But this code get Compile Error with X-button.
Rich (BB code):
Option Explicit
Sub Test()
  i = 0
End Sub
Just for the case , make sure that Option Explicit code line is in all code modules,
then try VBE - Debug - Compile VBAProject
 
Last edited:
Upvote 0
Interesting that if I run anything that causes an error from the Immediate Window it generates a msgbox-type error (OK, Help) , while creating the error within a procedure I get the usual runtime debug error dialog box. For example, put a number in the activecell then try:

From the Immediate Window: ?activecell.Value = 100/0

Within a module:
Code:
Sub Test
x = activecell.value/0
End sub
 
Upvote 0
In the VB editor select tools > options > General > Break in class module > OK.

Do you now get the "Normal" dialogue box?
 
  • Like
Reactions: ZVI
Upvote 0
@JoeMo

I think that I mentioned that earlier. The Excel error messages do no have a Debug button because it is a worksheet error and not a code error.
 
Last edited:
Upvote 0
I get the debug run time error dialog box when I run the sheet code below.
Rich (BB code):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim R As Long
'Next line generates runtime error if the sheet does not contain the string "BIG ERROR"
R = Cells.Find("BIG ERROR").Row
End Sub

I just tried this, and I also got the error with the debug button. BUT, if I try this code, I don't get an error with the debug button.

Code:
Sub Test()

Dim r As Range
r = ThisWorkbook.Sheets("Sheet1").Range("A1")

End Sub

Could you try this and tell me what you get? In the past, I always remember getting the windows with the Debug button on this error, regardless of what kind of module the code was in.
 
Upvote 0
I just tried this, and I also got the error with the debug button. BUT, if I try this code, I don't get an error with the debug button.

Code:
Sub Test()

Dim r As Range
r = ThisWorkbook.Sheets("Sheet1").Range("A1")

End Sub

Could you try this and tell me what you get? In the past, I always remember getting the windows with the Debug button on this error, regardless of what kind of module the code was in.
I get a debug error with that.
 
Upvote 0
In the VB editor select tools > options > General > Break in class module > OK.

Do you now get the "Normal" dialogue box?

Sorry, Fluff. I didn't have my browser window refreshed when I posted my last comment, so I had not seen yours yet.

I just made that change to my VBE, and now I get the error window with the Debug button inside a sheet module on this code.

Code:
Sub Test()

Dim r As Range
r = ThisWorkbook.Sheets("Sheet1").Range("A1")

End Sub

So that looks like it has fixed my problem! Thank you!!
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,714
Members
452,995
Latest member
isldboy

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