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. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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 Lounger -
WSpieterse
AskWoody Lounger
Viewing 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
-
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
48 minutes ago -
Plugged in 24-7
by
CWBillow
8 hours, 9 minutes ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
13 hours, 1 minute ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
10 hours, 10 minutes ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
2 days, 4 hours ago -
Are Macs immune?
by
Susan Bradley
2 hours, 13 minutes ago -
HP Envy and the Function keys
by
CWBillow
1 day, 11 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
2 days, 15 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
2 days, 15 hours ago -
Unable to update to version 22h2
by
04om
1 day, 6 hours ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
2 days, 23 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
2 days, 23 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
2 days, 9 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
3 days, 12 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
3 days ago -
Is your battery draining?
by
Susan Bradley
33 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
34 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
3 days, 16 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
1 day, 2 hours ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
3 days ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
2 days, 16 hours ago -
National scam day
by
Susan Bradley
1 day, 23 hours ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
2 days, 20 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
4 days, 17 hours ago -
Tools to support internet discussions
by
Kathy Stevens
3 days, 5 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
4 days, 8 hours ago -
AI is good sometimes
by
Susan Bradley
5 days ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
4 days, 14 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
6 days ago -
June KB5060842 update broke DHCP server service
by
Alex5723
5 days, 23 hours 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.