473,508 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Debugging in VBA - 2A) The Code Pane (F7)

NeoPa
32,557 Recognized Expert Moderator MVP
Table of Contents - [Debugging in VBA]
Previous Chapter - [Debugging in VBA - 1) Overview]
Next Chapter - [Debugging in VBA - 2B) The Project Explorer Pane (Ctrl-R)]
-----------------------------------------------------------------------------------------------
2A) The Code Pane (F7).
This is the main pane and doesn't have a title.
From here you can do all sorts of things with the code, including editing it.


As mentioned earlier, the code can be developed (written) into the Code Pane. This is possibly the least exciting use for this pane however.
In here you can :
  1. Go to various sections of the code quickly and easily.
    You can open the code for various modules (See Project Explorer pane). You can also select a procedure from the Object Selection box (Top-Left) in conjunction with the Event Selection box (Top-Right).
  2. Pause the execution of the code (as it's running).
    This can be done manually (Ctrl-Break); by a breakpoint; by an error; or coming to the end of the code. When stopped (as opposed to finished) this is called Break Mode.
  3. See the current contents of simple variables.
    (See attached picture - the lighter yellow area.) This shows up when you hover the mouse cursor over the name of a variable in the code.
  4. Set & Clear Breakpoints.
    (See attached picture - the lines with the reddish background are breakpointed.) This means that when the code execution hits this line it will stop. Setting and clearing breakpoints is as simple as clicking in the margin where the redddish spot appears.
  5. Resume execution from the current position in the code.
    (See attached picture - the line in yellow is the current position.)
    Options available :
    • F5 - Resumes execution. Doesn't stop unless stopped (See paragraph b above).
    • F8 - Execute single instruction (Step Into). Stops at the very next instruction. Including the first instruction of a sub-procedure if the current line includes one.
    • Shift-F8 - Stops when it hits the following line in the code (Step Over).
      Doesn't stop within a sub-procedure even if the current line includes one.
    • Ctrl-Shift-F8 - Resume until the current procedure is complete (Step Out).
    • Ctrl-F8 - Resume until the code hits the line the cursor is on (Run to Cursor).
  6. Resume execution from your chosen position in the code.
    Right-click on your chosen line and select 'Set Next Statement'. This allows particular lines to be skipped where necessary, or even a line to be retried after changes have been made.

Attached Images
File Type: jpg VBACode.Jpg (84.0 KB, 1747 views)
May 20 '07 #1
0 7605

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

Similar topics

1
3811
by: jim.eggleston | last post by:
I just figured out a reasonably decent way to use pdb in SciTE for debugging Python scripts. Debugging takes place in the SciTE output window. I have only tested this with SciTE on Windows. Here...
2
1717
by: thomas | last post by:
I have an c# exe-application which referenced a managed c++ dll. The managed c++ dll is an wrapper for some unmanaged c++ classes in a separate dll. That works fine but I can't debug in the...
2
1669
by: So | last post by:
Hi All, Does any one know how to enable the debugging in VS2003 on Win2003 Ent, for local or remote ASP.net web project. The instructions given in the MSDN does not help. Even tried the ones at...
14
8647
by: | last post by:
I cannot for the life of me get remove debugging to work. I continue to receive "Error while trying to run project: Unable to start debugging on the web server. Access is denied. Verify that you...
0
2030
by: Joseph S. | last post by:
hi all, debugging PHP applications interactively is possible, easy and free. I am talking about PHPEclipse and using it for debugging over several scripts or debugging through a session. Since I...
0
1479
by: yaru22 | last post by:
Hi. I'd like to know how to debug in eclipse+pydev. In the menu, "Pydev Debug", there's Start Debug Server option, but I don't know how to use it. Few questions I have about debugging are:...
0
18137
NeoPa
by: NeoPa | last post by:
VBA executes whenever the code is triggered from within your project. This can be from all sorts of object events from simply opening a form to clicking on a command button. When something doesn't...
0
1075
by: Brad Pears | last post by:
I have a simple little test project and am testing out some system.io commands... I have a main form and in the form's load event I am running some code which I am debugging... When the code...
0
6787
NeoPa
by: NeoPa | last post by:
Table of Contents - Previous Chapter - ----------------------------------------------------------------------------------------------- 3) General Tips. The first and most important tip is...
0
6296
NeoPa
by: NeoPa | last post by:
Table of Contents - Previous Chapter - Next Chapter - General Tips] ----------------------------------------------------------------------------------------------- 2G) The Watch Pane. This...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7118
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.