Solved

Setting a breakpoint in VBA using Excel 2007

Posted on 2011-09-07
4
368 Views
Last Modified: 2012-06-27
I am starting to code in VBA Excel 2007 but want to have the code to stop at a breakpoint. When I press F9 on the code, it displays the red dot, so I get the feeling it should stop there. But it does not.

What do I need to do?

Thanks,
newbieweb

0
Comment
Question by:newbieweb
4 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 250 total points
ID: 36498665
The code is probably not being executed. Is it inside a condition? Set the break point in another location that you are sure will be executed.

If you are sure the code is being executed, try using a Stop statement.

Kevin
0
 
LVL 46

Assisted Solution

by:Martin Liss
Martin Liss earned 150 total points
ID: 36498667
It means that the code doesn't get there. Put a breakpoint at the top of the procedure. Does it get there? And it would help to post your code and indicate where you have the breakpoint set.
0
 
LVL 59

Assisted Solution

by:Chris Bottomley
Chris Bottomley earned 100 total points
ID: 36498670
Are you sure the code line where you set the breakpoint is actually being executed and note if stepping through then there is no stop as such ... only if it runs normally.

Also you can add a command STOP ... this will stop the code if the instruction is encountered.

Chris
0
 

Author Closing Comment

by:newbieweb
ID: 36498721
Thanks!  There was code on Open that was creating the problem.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now