473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,320 developers and data experts.

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

NeoPa
32,556 Expert Mod 16PB
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, 1738 views)
May 20 '07 #1
0 7585

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

Similar topics

1
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
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
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
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
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
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
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
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
NeoPa
by: NeoPa | last post by:
Table of Contents - Previous Chapter - ----------------------------------------------------------------------------------------------- 3) General Tips. The first and most important tip is...
0
NeoPa
by: NeoPa | last post by:
Table of Contents - Previous Chapter - Next Chapter - General Tips] ----------------------------------------------------------------------------------------------- 2G) The Watch Pane. This...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.