I’m trying to debug some VB code in the VB editor and it’s refusing to step through the code. When I press F8 the cursor moves to the next line of code and highlights in yellow as I expect, but the code is not executed. When I click on the run button, it doesn’t.
The code is stepping out of a loop prematurely but never at the same record and I’m trying to find out why.
Can there be a relationship between the behaviour of VBE and the code or is there something wrong with my installation?
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
VB edit not responding (Excel 2000 SP-3)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » VB edit not responding (Excel 2000 SP-3)
- This topic has 39 replies, 5 voices, and was last updated 20 years, 7 months ago.
AuthorTopicWSRConnell
AskWoody LoungerNovember 3, 2004 at 7:50 pm #411790Viewing 2 reply threadsAuthorReplies-
WSsdckapr
AskWoody LoungerNovember 4, 2004 at 2:18 am #895409What are the indications that it doesn’t execute?
Add a line like:
Msgbox “test”In the code and run it. Does the msgbox popup? If so the code is running. Perhaps the screen is not updating when you step through
(do you have a line:
Application.screenupdating = false
in the code)Steve
-
WSRConnell
AskWoody LoungerNovember 4, 2004 at 3:16 pm #895589Steve,
I have the VBE window restored so I can see the spreadsheet behind it. One of the lines of code is supposed to Activate a different sheet and it does not.
Screen updating is not off. The macro is running fine up to some indeterminate point, so I am watching it do its thing.
There is no user-defined function as suggested by Jan. -
WSHansV
AskWoody Lounger -
WSRConnell
AskWoody Lounger -
WSpieterse
AskWoody Lounger -
WSRConnell
AskWoody Lounger -
WSsdckapr
AskWoody Lounger -
WSRConnell
AskWoody LoungerNovember 4, 2004 at 6:29 pm #895690 -
WSHansV
AskWoody Lounger -
WSRConnell
AskWoody Lounger -
WSRConnell
AskWoody Lounger -
WSRConnell
AskWoody LoungerNovember 5, 2004 at 4:12 pm #896131Hans,
Following your post about my error-trapping I reviewed and revised my process and moved the folder checking out of the loop. Now that other errors are no longer ignored, a new problem has been revealed! On the 20th record, the advanced filter fails. Have I overloaded a stack somewhere or something? Do you have the time or patience to look at my revised code? -
WSsdckapr
AskWoody Lounger -
WSRConnell
AskWoody Lounger -
WSsdckapr
AskWoody LoungerNovember 5, 2004 at 6:09 pm #896191What is the line of code? (ie the TEXT of the line)
Do you mean this line?
Range(“Advances”).AdvancedFilter Action:=xlFilterCopy, _if so, What is the value of of “Firm” at this time?
I can’t seem to get your example file to get to this point to check it out, since I seem to be missing a “required file” on the “Z-Drive”
(can you modify the code to fill any required variables without using this file for demo purposes?)
Also what dates do you choose (just wondering if the date range make a difference, when I try to replicate your error)Steve
-
WSRConnell
AskWoody LoungerNovember 5, 2004 at 7:24 pm #896218Steve,
The macro breaks at the line, “Range(“Range(“Advances”).AdvancedFilter Action:=xlFilterCopy, _” etc.
The value of “Firm” is different each time through the loop – see “Firm” column in Advances column G.
I have removed te code that requires network drive mappings so that it now looks for and creates folders on the C drive.
I have assigned values to the date variables.
It still breaks at a different spot each time. I wonder if the code is somehow out-running Excel’s refresh rate.
Modified code attached. -
WSsdckapr
AskWoody LoungerNovember 5, 2004 at 7:54 pm #896228I do not get any VB or excel errors. Your code actually “crashes” xl97 on my machine.
Personally, I would try to “revamp” the code to not do all the selecting and activating. I would create worksheet objects and explicit define the sheets that ranges should reference.
The code will speed up and there should be less problems
Steve
-
WSsdckapr
AskWoody LoungerNovember 5, 2004 at 7:54 pm #896229I do not get any VB or excel errors. Your code actually “crashes” xl97 on my machine.
Personally, I would try to “revamp” the code to not do all the selecting and activating. I would create worksheet objects and explicit define the sheets that ranges should reference.
The code will speed up and there should be less problems
Steve
-
H. Legare Coleman
AskWoody PlusNovember 8, 2004 at 2:55 pm #896353Your problem appears to be caused by a bug in Excel (several versions). It is most likely a memory leak in the Advanced Filter method. Try the code below and see if it does what you want. It seems to work on my system, and I think it does the same thing that your code does.
Long piece of code (almost 5,000 characters) moved to attachment by HansV
-
WSRConnell
AskWoody LoungerNovember 8, 2004 at 2:15 pm #896995Legare,
Thank you so much for taking the time to SOLVE my problem. So often the problems or questions posted here must require fairly simple answers, so it takes someone special to look beyond the obvious. I was sure my problem had to be more than coding because of the other symptoms. Initially, VBE was not acting normally. As I gradually commented-out bits of code to zero-in on the cause, other symptoms appeared. After a code break, when I clicked END instead of DEBUG, Excel would hang and I’d have to use Task Manager to kill it. I was about to use a time delay to see if that would help.
I am writing this before I have taken a good look at your code because I wanted to let you know how much I appreciate your effort. But it appears you have written code to replace the advanced filter method.
When you say “It is most likely a memory leak in the Advanced Filter method”, are you suggesting we avoid the advance filter in a loop? Are you aware of a KB article about this? Is there any way I can help get the word out about this? -
H. Legare Coleman
AskWoody PlusNovember 8, 2004 at 3:14 pm #897031Something in your loop appears to be causing a memory leak, and I am guessing that it is the advanced filter. I have no way to prove it, and I am not aware of any KB article. I would suggest avoiding the use of advanced filter in a loop, but since I can’t prove that this is the source of the problem that is just a suggestion.
-
H. Legare Coleman
AskWoody PlusNovember 8, 2004 at 3:14 pm #897032Something in your loop appears to be causing a memory leak, and I am guessing that it is the advanced filter. I have no way to prove it, and I am not aware of any KB article. I would suggest avoiding the use of advanced filter in a loop, but since I can’t prove that this is the source of the problem that is just a suggestion.
-
WSRConnell
AskWoody LoungerNovember 8, 2004 at 2:15 pm #896996Legare,
Thank you so much for taking the time to SOLVE my problem. So often the problems or questions posted here must require fairly simple answers, so it takes someone special to look beyond the obvious. I was sure my problem had to be more than coding because of the other symptoms. Initially, VBE was not acting normally. As I gradually commented-out bits of code to zero-in on the cause, other symptoms appeared. After a code break, when I clicked END instead of DEBUG, Excel would hang and I’d have to use Task Manager to kill it. I was about to use a time delay to see if that would help.
I am writing this before I have taken a good look at your code because I wanted to let you know how much I appreciate your effort. But it appears you have written code to replace the advanced filter method.
When you say “It is most likely a memory leak in the Advanced Filter method”, are you suggesting we avoid the advance filter in a loop? Are you aware of a KB article about this? Is there any way I can help get the word out about this? -
H. Legare Coleman
AskWoody PlusNovember 8, 2004 at 2:55 pm #896354Your problem appears to be caused by a bug in Excel (several versions). It is most likely a memory leak in the Advanced Filter method. Try the code below and see if it does what you want. It seems to work on my system, and I think it does the same thing that your code does.
Long piece of code (almost 5,000 characters) moved to attachment by HansV
-
WSRConnell
AskWoody LoungerNovember 5, 2004 at 7:24 pm #896219Steve,
The macro breaks at the line, “Range(“Range(“Advances”).AdvancedFilter Action:=xlFilterCopy, _” etc.
The value of “Firm” is different each time through the loop – see “Firm” column in Advances column G.
I have removed te code that requires network drive mappings so that it now looks for and creates folders on the C drive.
I have assigned values to the date variables.
It still breaks at a different spot each time. I wonder if the code is somehow out-running Excel’s refresh rate.
Modified code attached. -
WSsdckapr
AskWoody LoungerNovember 5, 2004 at 6:09 pm #896192What is the line of code? (ie the TEXT of the line)
Do you mean this line?
Range(“Advances”).AdvancedFilter Action:=xlFilterCopy, _if so, What is the value of of “Firm” at this time?
I can’t seem to get your example file to get to this point to check it out, since I seem to be missing a “required file” on the “Z-Drive”
(can you modify the code to fill any required variables without using this file for demo purposes?)
Also what dates do you choose (just wondering if the date range make a difference, when I try to replicate your error)Steve
-
WSRConnell
AskWoody Lounger -
WSsdckapr
AskWoody Lounger -
WSRConnell
AskWoody LoungerNovember 5, 2004 at 4:12 pm #896132Hans,
Following your post about my error-trapping I reviewed and revised my process and moved the folder checking out of the loop. Now that other errors are no longer ignored, a new problem has been revealed! On the 20th record, the advanced filter fails. Have I overloaded a stack somewhere or something? Do you have the time or patience to look at my revised code? -
WSHansV
AskWoody Lounger -
WSRConnell
AskWoody LoungerNovember 4, 2004 at 6:29 pm #895691 -
WSsdckapr
AskWoody Lounger -
WSRConnell
AskWoody Lounger -
WSpieterse
AskWoody Lounger
-
-
-
WSRConnell
AskWoody Lounger
-
-
-
WSHansV
AskWoody Lounger
WSRConnell
AskWoody LoungerNovember 4, 2004 at 3:16 pm #895590Steve,
I have the VBE window restored so I can see the spreadsheet behind it. One of the lines of code is supposed to Activate a different sheet and it does not.
Screen updating is not off. The macro is running fine up to some indeterminate point, so I am watching it do its thing.
There is no user-defined function as suggested by Jan.WSpieterse
AskWoody LoungerWSpieterse
AskWoody LoungerViewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
The Simpsons Kills Off Marge In Shocking Season Finale Twist
by
Alex5723
1 hour, 7 minutes ago -
AnduinOS (Windows 11 look alike)
by
Alex5723
1 hour, 46 minutes ago -
Total Commander updates
by
Alex5723
1 hour, 57 minutes ago -
Have you checked your FICO score?
by
Susan Bradley
2 hours, 29 minutes ago -
Chrome ‘Scream to Unlock’ : Scream louder to get more time on Social Media
by
Alex5723
3 hours, 54 minutes ago -
Taskbar icon size
by
CWBillow
7 hours, 47 minutes ago -
Is it Local or is it Microsoft Account?
by
RetiredGeek
3 hours, 11 minutes ago -
Does Your State Reveal Who’s Been Hacked?
by
Nibbled To Death By Ducks
23 hours, 23 minutes ago -
A one-year extension to Windows 10 โ almost free!
by
Susan Bradley
4 hours, 30 minutes ago -
Windows Configuration Update (KB5062324) โ June 2025
by
Alex5723
10 hours, 46 minutes ago -
A federal judge sides with Anthropic in lawsuit over training AI
by
Alex5723
1 day, 4 hours ago -
Name of MS Word Formatting Feature
by
John Baum
17 hours, 3 minutes ago -
InControl Failure?
by
Casey H
15 hours, 26 minutes ago -
Microsoft : Free 1 year support for Windows 10 after EOL
by
Alex5723
17 hours, 8 minutes ago -
MS-DEFCON 3: Businesses must tread carefully
by
Susan Bradley
8 hours, 52 minutes ago -
McLaren Health Care says data breach impacts 743,000 patients
by
Nibbled To Death By Ducks
2 days, 3 hours ago -
WhatsApp banned on House staffers’ devices
by
Alex5723
1 day, 22 hours ago -
Is your device eligible?
by
Susan Bradley
2 days, 6 hours ago -
Windows 11 Insider Preview build 26200.5661 released to DEV
by
joep517
2 days, 12 hours ago -
Windows 11 Insider Preview build 26120.4452 (24H2) released to BETA
by
joep517
2 days, 12 hours ago -
Hello Windows…My Problem is Windows Hello…
by
rdleib
2 days, 13 hours ago -
New Canon Printer Wants Data Sent
by
Win7and10
2 days, 14 hours ago -
I set up passkeys for my Microsoft account
by
Lance Whitney
3 hours, 17 minutes ago -
AI is for everyone
by
Peter Deegan
2 days, 13 hours ago -
Terabyte update 2025
by
Will Fastie
2 days, 7 hours ago -
Migrating from Windows 10 to Windows 11
by
Susan Bradley
14 hours, 53 minutes ago -
Lost sound after the upgrade to 24H2?
by
Susan Bradley
1 day, 7 hours ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
1 day, 16 hours ago -
Plugged in 24-7
by
CWBillow
2 days, 22 hours ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
4 days, 1 hour ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.