-
WSSammyB
AskWoody LoungerDuh… Thanks much!!!
-
WSSammyB
AskWoody LoungerThanks, Hans. That’s even easier than I remember. –Sam
-
WSSammyB
AskWoody Lounger, that’s exactly what’s needed. Initially, I thought why bother with Dir, I’ll just use Application.FileSearch
Bad idea, I forgot that I have over a million files, 1400 folders and half a terabyte of tiffs. Not a good environment for FileSearch
I was thinking I would have to construct a sheet with a lookup table, but Alan’s scheme works a treat and and seems fast enough. Thanks for the effort: I hadn’t realized that you need to check the attributes. It’s annoying that the dir(… vbDirectory) includes directories rather than excluding all but directories. Anyway, thanks again! –SamPS hijacking the thread. Can you find a link to the ShellAndWait api? I need to process the dozen or so tiffs that I found, wait, and then process the next set. The program that processes the tiffs must have a memory leak because the time to process a tiff increases a minute for every 13 tiffs, so I have to split up my efforts.
-
WSSammyB
AskWoody LoungerThat is very cool, but it took forever (5-10 minutes) on a small test system with XL whining about having to wait for another OLE process. Being a glutton for punishment, I ran it again and it only took 20 seconds, However, I ran it again several hours later and it took 6 minutes. This will be running on a terabyte disk server, so even the 20 seconds is not acceptable, I can just manually traverse the directory tree. I haven’t tried using the Windows API directly yet, probably should do that, but it ‘s a pain. Thanks! –Sam
-
WSSammyB
AskWoody LoungerThanks, Mark for the confirmation! I was just trying to help a friend. It turned out even worse: he had developed a class using that keyed collection as a base class and then wanted to sort it by keys. You wonder why they didn’t seal all of the VB library. Like you, I told him to rewrite it using generics. Thanks again.
But, I’m still intrigued by how Quick Watch can see the keys and that each entry in the collection is a key value pair. Have you ever used System.Reflection? Could this be of use here?
-
WSSammyB
AskWoody Lounger>the problem here is the CopyTo function
Right, it will take a different approach. The real problem is that IList does not have a ToArray method. I tried casting it into something else, but failed.> you could always remove the line breaks
> you have been a VB(.NET) guy
At this point, I’ve forgotten more than I know about VB. For about a year, I’ve been creating tools for a Geographic Information System, ArcMap, using C#. Its object model is so horrific http://edndoc.esri.com/arcobjects/8.3/Diagrams/Map Layer Object Model.pdf[/url], that I’ll never complain about Office objects again.Eureka!
string[] keys = new List(sList.Keys).ToArray();
-
WSSammyB
AskWoody LoungerI’m in the process of converting a zillion lines of code from framework 1.1 to framework 2.0. As we convert to generics we are entering code like this a lot, so a one-liner would mean less time to convert. Plus, it’s just a simple copy: should be one line.
BTW, there was a typo in the code: here is a working example:
private void button1_Click(object sender, EventArgs e) { SortedList sList = new SortedList(); sList.Add("A", "1"); sList.Add("B", "2"); sList.Add("C", "3"); // // Should be a one-liner for the next three lines IList keyList = sList.Keys; string[] keys = new string[keyList.Count]; keyList.CopyTo(keys, 0); }
-
WSSammyB
AskWoody Loungerchemicals in the brain becoming depleted
-
WSSammyB
AskWoody LoungerI have to manually crop each image, so it is one less mouse-click if I preselect the crop tool. Just tried .Execute & it works:
Application.CommandBars("Picture").FindControl(ID:=732).Execute
Thanks anyway! I was just feeling lazy today (320 images to crop).
-
WSSammyB
AskWoody LoungerWhat!
-
WSSammyB
AskWoody LoungerJust want to select the tool
-
WSSammyB
AskWoody LoungeriMax = Application.Max(Column(1))
It dosn’t work for me! -
WSSammyB
AskWoody Lounger -
WSSammyB
AskWoody LoungerFormula for D2 is
=IF(YEAR(C2)=2007,IF(A2 & B2=Sheet2!A2 & Sheet2!B2,"planned","not planned"),"")
-
WSSammyB
AskWoody LoungerBizzare! That works! Thanks! I’d like to see an expalnation of why.
BTW, I resorted to some really weird code instead:
iMax = [Max(Sheet1!C:C]I don’t do that very often because there is a lot of overhead; ie, don’t do it in a loop. But, for initializing your variables, it’s quick & dirty. Dirty, because if you move column C, your code no longer works.
![]() |
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 |

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
-
regarding april update and may update
by
heybengbeng
1 hour, 19 minutes ago -
MS Passkey
by
pmruzicka
7 hours, 5 minutes ago -
Can’t make Opera my default browser
by
bmeacham
8 hours, 59 minutes ago -
*Some settings are managed by your organization
by
rlowe44
6 hours, 52 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
7 hours, 53 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
1 day, 3 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day, 12 hours ago -
AI slop
by
Susan Bradley
2 hours, 41 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 13 hours ago -
Two blank icons
by
CR2
1 hour, 36 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 22 hours ago -
End of 10
by
Alex5723
2 days, 1 hour ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
23 hours, 21 minutes ago -
test post
by
gtd12345
2 days, 7 hours ago -
Privacy and the Real ID
by
Susan Bradley
1 day, 21 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 13 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days, 11 hours ago -
Upgrading from Win 10
by
WSjcgc50
23 hours, 31 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
1 day, 3 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
3 days, 3 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 15 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
3 days, 5 hours ago -
Are manuals extinct?
by
Susan Bradley
5 hours, 48 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 14 hours ago -
Network Issue
by
Casey H
3 days, 1 hour ago -
Fedora Linux is now an official WSL distro
by
Alex5723
4 days, 2 hours ago -
May 2025 Office non-Security updates
by
PKCano
4 days, 3 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
4 days, 4 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
3 days, 5 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
4 days, 7 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.