Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Click on button in Excel application - VBA debugger opens

Status
Not open for further replies.

princessk1

Programmer
Feb 28, 2002
74
CA
I have an Excel application written with VBA code. When I click on one of the buttons, it automatically opens up the debugger but no error is occurring. I could step through the code if I wanted to. There is no breakpoint set. What are the reasons it would be doing this?
 
Not sure but there are a couple of ways to troubleshoot it. Try some of the following:

1) Compile the application if the 'Compile' menuitem is available. Fix any syntax errors.
2) Add error handling to the code if not already done or add an 'On Error Resume Next' to the beginning and put a breakpoint before it exits the function. Enter ?Err.Number in the immediate window to see if it might have had some type of error.
3) And this is the one I expect is causing the problem, put a breakpoint on the beginning of each function or subroutine called by the code. If they don't all have error handling then put a breakpoint where it exits the procedure and check for and error number before letting the procedure continue. If error handling isn't on the lower level calls the error 'bubbles up' and seems to show in the procedure that didn't really have the error.

One of these should find the problem. If not repost.


----------------------
scking@arinc.com
Life is filled with lessons.
We are responsible for the
results of the quizzes.
-----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top