Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Setting a breakpoint in VBA using Excel 2007

Posted on 2011-09-07
4
Medium Priority
?
378 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 1000 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 49

Assisted Solution

by:Martin Liss
Martin Liss earned 600 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 400 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

783 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