472,133 Members | 1,173 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

Breakpoint in Excel VBA not breaking

Working with Excel 2003, I have a worksheet that I programatically generate from another worksheet. On this worksheet are two events, a selection change event and worksheet_change event. The selection change event just forces an application.calculate. The worksheet change is:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Worksheet_Change(ByVal Target As Range)
  3.   'Ensure we are connected to code and disable all events/updating
  4.   If Not StartEvent Then Exit Sub
  6.   WBSFinalWorksheetChange Target
  8.   'Reenable events/updating
  9.   EndEvent
  11. End Sub
I know the code runs when the worksheet_change should, but if I put a breakpoint on the method header, the code doesn't stop at all. When the code runs, it reaches a command to do a findnext, and never reaches the next line (I used msgbox lines throughout the code to track the codes progress since breakpoints weren't working) There is no error handling in the code, so an error should kick it out, but I think it's a function of the breakpoints not working. Has anyone seem anything like this or have any idea what is going on?
May 23 '08 #1
1 4471
1,295 Expert 1GB
I think it's because the 'If Not StartEvent Then Exit Sub'

perhaps you're always exiting there, so you never reach the code below (the one with the breakpoint)

now, if your breakpoint is in the EVENT header, well, since that line is not an executable one, it'll never be reached, why dont you put the break point in the first executable line (lets say the 'If Not StartEvent Then' one.
Jun 23 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Phil Powell | last post: by
3 posts views Thread by Kevin | last post: by
1 post views Thread by (Pete Cresswell) | last post: by
3 posts views Thread by kunal.kewalramani | last post: by
5 posts views Thread by Maxwell2006 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.