|
-
Jul 14th, 2006, 03:28 AM
#1
Thread Starter
Hyperactive Member
-
Jul 14th, 2006, 06:17 AM
#2
Re: VBA Debugger Question
you can put a stop command in your code, before the code you want to step through, then run to the stop command and step through from there, just remember to remove the stop command when finished debugging.
pete
-
Jul 14th, 2006, 06:27 AM
#3
Frenzied Member
Re: VBA Debugger Question
Or just set a breakpoint. Click in the left margin to set it, click again to remove it.
Tengo mas preguntas que contestas
-
Jul 14th, 2006, 08:56 AM
#4
Thread Starter
Hyperactive Member
Re: VBA Debugger Question
Use both those methods at the moment, trouble is they are both clumsy.
I was hopeing there was some obscure command, flag or trick to get the debugger to run through the code in a module automatically.
Signature Under Construction 
-
Jul 14th, 2006, 09:59 AM
#5
Frenzied Member
Re: VBA Debugger Question
If you don't have a breakpoint or stop anywhere in the module, why would it stop there?
Tengo mas preguntas que contestas
-
Jul 14th, 2006, 10:06 AM
#6
Thread Starter
Hyperactive Member
Re: VBA Debugger Question
The point is that I have Modules in which I have code that I know is fine, but when I am running the debugger I have to go through the code in the debugger.
At present the only way to get past the code without stepping through each line
is to use Run to Cursor, putting the cursor on the last line of the Sub or Function;
or to use Breakpoints and just use Run when I enter one of the modules Subs/Functions.
Unfortunately these are not full satisfactory methods as they tend to have problems if
you where to use Exit Sub or Exit Function.
Which is why I was wondering if there was a way to make a Module hidden/transparent to the debugger so that when the program flow enters one of the
subs or functions it runs without displaying on the debugger.
Signature Under Construction 
-
Jul 14th, 2006, 10:27 AM
#7
Re: VBA Debugger Question
Go to "View" - "Toolbars", and tick "Debug". This will add a new toolbar which contains several icons, including "Step Into", "Step Over", and "Step Out".
If you press "Step Over" on a line which calls another sub, the other sub will run without 'stepping'.
If you press "Step Out", the rest of the current sub will run without 'stepping'.
-
Jul 14th, 2006, 10:35 AM
#8
Thread Starter
Hyperactive Member
Re: VBA Debugger Question
Hmm, Might have known it would be something I cannot use.
I am using Excel 2002 SP3 at work, and it does not have Debug as one of the Toolbars.
I am presented with :- Standard, Formatting, Borders, Chart, Control Toolbox,
Drawing, External Data, Forms, Formula Auditing, Picture, Pivot Table,
Protection, Reviewing, Task Pane, Text to Speech, Visual Basic,
Watch Window, Web & WordArt
Signature Under Construction 
-
Jul 14th, 2006, 10:45 AM
#9
Re: VBA Debugger Question
Try it inside the VB editor (where the code runs), rather than in Excel itself.
-
Jul 14th, 2006, 11:10 AM
#10
Thread Starter
Hyperactive Member
Re: VBA Debugger Question
Great, not the solution I would like, spoilt from using a decent Modula-2 compiler in Poly. But at least it is better than stepping through, or using Run to Cursor.
Thanks.
Signature Under Construction 
-
Jul 14th, 2006, 04:17 PM
#11
Frenzied Member
Re: VBA Debugger Question
I'm glad you found some sort of solution, but I still don't see why it matters if your code runs through the not-to-be-tested module as long as it doesn't stop there. Does that module take a long time to run?
Tengo mas preguntas que contestas
-
Jul 17th, 2006, 03:32 AM
#12
Thread Starter
Hyperactive Member
Re: VBA Debugger Question
Some of the Subs in the modules involve very repetitive work, which can, when running through in Debugger greatly increase the running time of the code.
In some cases I might have a sub which would be called 30 or 40 times, or more.
Constantly trying to use Run to Cursor each time it was called was difficult, especially as the part where the macro was failing was in the calculations around that sub, and I could not use a run until condition as the macro seemed to be failing at different points depending on the data I used..
Signature Under Construction 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|