This is somewhat related to a similar post, but that post was Visual Studio 6 in general and a lot of the suggestions didn't apply to VB6.

Suggest or vote for tools/tips. Please one tool/tip per post so that everyone can vote on them individually. Include a brief description of what the tools do.

+25  A: 
Clay Nichols
+infinity. VB6 just isn't installed until you've done this.
I also love the "show all callers to this routine" and the find command which shows you all results in a docked window. Used to drop out to an external editor to do that before I found MZTools.
+1  A: 
Clay Nichols
I have the last version of CodeSmart. It has some useful code analysis features, but I use MZTools 99% of the time and CodeSmart 1%.
Nick Hebb
Yeah, MZ Tools is very well done. I"m planning to make a donation.
Clay Nichols
I looked @ Codesmart again and it has some really cool code navigation features like hyperlinks amongst code, as well as showing visually which IF a particular THEN goes with, graphically illustrating the flow of CASE statements.Mztools has cool stuff bit it's a bit hard to access (i.e., to find references : right click, Mztools, sub menu- References, etc.
Clay Nichols
+3  A: 

Matt Curlands Power VB book and the VBoost tools that came with it, especially the Type library editor.

Just watch out for the non-DEP compliant techniques.

The title was "Advanced Visual Basic 6"
+56  A: 

Enable mouse wheel in VB6:

Microsoft:enable the mouse scroll wheel

Words fail, sorry I can't +5 you.
I wish I could +1 you over and over again, that's fantastic
I still have this as:
Jim H.
+1 - Couldn't live without this one.
Mike Spross
+1, thankfully there are add-ins that you can use to enable it. I didn't see the microsoft link, thanks.
Definitely. I recommended this on a VB6-VB.NET project not too long ago and the developers there were ecstatic. They had been using a 3rd party plugin (don't recall the name) but it didn't work in split windows, whereas the MS one did and felt smoother to them.
Ahmad Mageed
+1, but the MS add-in doesn't work for VBA. At my company we use a free tool Gazanov VBScroll, which works with VBA and VB6 and also works in the SDI mode of the VB6 IDE.
@MarkJ - awesome, I could not get the microsoft one working on win7 for some reason. This worked though.
+5  A: 

I realllly hate checking to see if an array is uninitialized by passing it to a helper function that tries to do a UBound and catches the error if it occurs.


Use VarPtr to get the array's address, pass the address to CopyMemory to get the SafeArray structure for the array, if the SafeArray structure indicates 0 dimensions, the array is uninitialized.

EDIT thanks to Lance for good link with example

Thanks, I've been looking for exactly that. Here's a link for those interested:
Lance Roberts
Lance, thanks for the link, added to post.
Long long ago I would have said tricks like this make it harder to upgrade your code to the next version of the language. HA!
lol I'm laughing because it totally sounds like something I would do. But honestly... Introducing RTLMoveMemory just to avoid testing by exception? I think the risks outweigh the rewards. Especially when your program stops working when MS nukes unsafe API calls.
Mister, your subscript is out of range.
@Oorang If you want to debug with Break on All Errors, this is a godsend.
Mark Hurd
@Mark Hurd, I'll conceed that point. May stance isn't really "never do that" so much as it is "have a good reason before you do that". That's a pretty good reason:)
+2  A: 

I discovered a lot of things when I was first learning by using the wizards to make forms/small applications, and then examining the code they output.

+6  A: 

Design Patterns by the GoF. While it doesn't seem specific for VB6 the fact that most of the patterns are based interface implementation and aggregating objects (as opposed to inheritance) makes it well suited for use with VB6. They talk about this on pages 16 to 18 and sum it up in one statement. Program to an interface, not an implmentation If there is one thing that VB6 and COM does well is handle interfaces.

RS Conley
+1. Can I also plug the book "Visual Basic Developer's Guide to UML and Design Patterns" by Griver etc? Explains design patterns in 100% VB6, discussing issues like circular references. Anyone whose main experience is in VB6 might find the gang of four book difficult, I recommend this fine book instead.
There is also Microsoft Press's "Visual Basic Design Patterns" by Stamatakis. Personally I hated it (it covers only 7 gang of four patterns and is poorly written). But some folks on Amazon have given it good reviews.
+4  A: 

The entire site here

I recommend Karl Peterson' One stop source and Randy Birch's VBnet (which has nothing to do with VB.NET) and Common Controls Replacement Project.

RS Conley
Maybe this is more appropriate to the "useful VB6 source code" question?
+22  A: 

After installing VB6, I always do these customisations on Tools-Options.

  • Switch off Auto Syntax Check on the Editor tab. You don't want message boxes when you type a syntax error - you just want the problem line shown in red so you can fix it later.

  • Switch on Require Variable Declaration on the Editor tab. Don't think, just do it.

  • Switch off Compile On Demand on the General tab. You want to be told about syntax errors immediately when you run your code, not just when the dodgy routine actually gets called.

  • EDIT: Prompt to save changes when program starts, on the Environment tab. (Thanks wqw for reminding me in the comments.)

  • Set Error Trapping to "Break on unhandled errors" on the General tab. Actually, this is a personal preference - but you should select the setting that suits you. Hopefully you've worked out an error handling strategy for the VB6 program?

  • I have an LCD screen, and the default colours don't work very well, so I change them to lighter ones. I'm also using the Consolas font. Makes my VB6 code look twenty-first century anyway :)

Switch Off Auto Syntax Check is GREAT! Never knew that was a possibility. That error popup has been bugging me for YEARS!
Clay Nichols
I didn't know about it for a few years, until a co-worker told me. (Thanks again Jon!)
Wow. I didn't know about Switch Off Auto Syntax Check either. That is super awesome.
Mike Spross
Somtimes it's convenient to only part complete a line of code while you go and copy an expression and that error message box was a pain in the neck. Thanks!!
All of these and "Prompt to save changes"
Very nice. Consolas make vb look way better on the HD.
+10  A: 
Yes, I used those buttons. VERY handy.
Clay Nichols
Here is a much better alternative:
+1  A: 

I haven't tried this myself yet, but CodeShine is a cheap refactoring add-in for VB6. It can do the useful extract method refactoring, apparently.

I must stop wasting time here and download the free trial to try it out.

+1  A: 

VB6 error handling sucks. So I've adopted these patterns to make it easier:

The Try-Catch block:

        On Error Goto catchX


catchX: if err.number then
            resume resumX
resumX: end if
        On Error Goto outside_catch_label_name
    'End Try

Including a stack trace in errors:

sub rethrow(byval source as string)
    Err.Source = Err.Source & vbNewLine & vbTab & "@ " & Source
    Err.Raise Err.Number, Err.Source, Err.Description
end sub

sub some_sub: on error goto throw
throw: if err.number then rethrow("some_sub")
end sub
FYI, MZ-tools (free addon listed in this Question) has a feature to let you automatically add Error Trapping. And you can configure it somewhat like a mail merge. Pretty slick.
Clay Nichols
You know I just never got why people don't like VB's error handling. Am I missing something?
@Oorang: I disliked it because it's too close to BASIC's GOTO/GOSUB roots. For programmers who are used to a more structured try/catch or try/finally style, it feels like a huge step backward. If you like the power and flexibility of GOTO, then enjoy yourself. But you should keep in mind the mental tax you're paying every time you ensure that you've wired up your error handling correctly.
Don Kirkby
+3  A: 

Check out

It has most tools I use for whenever I have to delve into VB6, plus a description of what they do. In addition to the tools mentioned here, it also has the following:

PDSA Property Creator

ADO Stored Proc Generator Add-in

Collection Class Master Add-in

+3  A: 

The vbAdvance add-in is now free.

vbAdvance is a Visual Basic Add-In that gives you access to advanced build features and many IDE convenience features. Create console apps, create standard DLLs that export functions, create a DllMain entry point in your DLLs, XP Manifest compiler for XP styles, Terminal Server, etc.

+5  A: 

Make My Manifest can produce Reg-Free COM manifests (chucking in "Styles" as needed, etc.). This allows XCopy deployment of many VB6 EXEs to WinXP or later.

No more "dependency" fears or DLL Hell!

Smart Client
Good one! Also great for producing portable applications that run from a CD or flash memory drive.
+3  A: 

The vbAccelerator website. It has so many great examples and free controls with the full source. The site has not been updates in a few years now, but it still keeps running and I still go back to it when working in VB6.

Keith Maurino
+1, but you might want to fix the typo in the website name!
+2  A: 

One great tool that is out there and I've used is called CodeFixer. I believe I first stumbled across CodeFixer here.

It's even open source. I have had a little contact with the author, Roger Gilchrist, and he seems to still be working on it in his, surely limited, free time.

Clay Nichols
Thanks for the tip, edited to help the google machine help people.

Aivosto's Project Analyzer

+8  A: 

I can't believe no one has yet posted Bruce McKinney's Hardcore Visual Basic (now free online on! OK it's a book rather than a piece of software, but it expands to a veritable cornucopia of tools and tips.

I loved this book. Any other fans will probably also be interested in the ill-fated tale of the third edition, along with errata and sample code:
Don Kirkby
+1  A: 

Spider Eye Flexbag

The collection class replacement from Spider Eye called Spider Eye Flexbag is an absolute must. Its 100% better than the collection classes that ship with VB and its blindingly fast compared to the original collections. The Flexbag collection was written by Gary Wisniewski of "Carl 'n Gary's Visual Basic Home Page" fame.

Unfortunately the Spider Eye website doesn't seem to have a link to the Flex Bag at the moment, but I'm sure if you contact them they'd be happy to sort something out for you. If you are doing any collection based work at all then it would be well worth the effort.

AVE Code Finder

The AVE Code Finder is handy because the Find function in the VB6 IDE can't be trusted. AVE Code Finder is also much much faster then the built in Find. It was written by Jarek Zwierz of but the site doesn't seem to exist anymore so the version I've linked to is at VB2TheMax.

+2  A: 

The VB6 IDE doesn't remember your preference for maximizing the code windows. To start up with the VB6 code windows maximized, set this string registry key:

[HKEY_CURRENT_USER\Software\Microsoft\Visual Basic\6.0]


+5  A: 

SmartIndenter takes care of all the auto-indenting. It does one thing and it does it really well. And it's free.


I... I think I love you...

VBDepend to have a deep view of your VB6 code base.

Issam Lahlali

The VB6 Credits Easter Egg that lists the development team :)

To show the VB6 Program Credits create an 'About' button to the standard toolbar and rename its caption to 'Show VB Credits'. Here's a bit more detail:

  1. Right-Click on a toolbar and select 'Customize'
  2. Within the 'Commands' tab select the 'Help' category
  3. Drag the 'About Microsoft Visual Basic' command (right windows of dialog box) up to the end of the standard toolbar.
  4. Without closing the 'Customize' dialog box, Right-Click on the button you just created and change its Name to 'Show VB Credits'
  5. Close 'Customize' and click the new button.

Bonus points for spotting famous names.