This post is in response to a few newsgroup questions recently, about disappearing Visio toolbars. Although I'm not going to offer a definitive fix for these occasional problems I thought I'd share a tip on how to recover your customized toolbars when things do go awry...
Built-in or Custom
Visio ships with a standard set of built-in menus and toolbars and these can be altered either by code or general user customization (by right-clicking on the toolbars). I'm assuming that you know how to change the toolbars via the latter method but, if not, have a look at this great walkthrough: 'How to create custom toolbars and tool buttons in Visio'.
So, there you are: you've created your new toolbars, arranged the buttons and edited the icons. Then, for some unknown reason the next time you open Visio they're gone! There are all sorts of reasons for this but amongst the usual suspects are add-ins that, like a badly behaved house guest, move in, change things around and then leave without returning them to the way that they found them.
Adobe Acrobat has been identified in the past as not playing well with Visio (certainly in earlier versions), but it's not the only one. For help on tracking down problem toolbars have a look at these two links:
- Toolbars that you customize are reset to use the default settings when you restart Visio 2003 or Visio 2002
- Toolbar, toolbar button, or menu bar is missing in Visio
A further aid in tracking down toolbar problems can be found by disabling all add-ins (via Tools / Trust Center... / Add-ins / 'Disable all Application Add-ins') and then re-introducing them incrementally to try and identify the problem one.
Backing up your work
OK, so the above will hopefully help in trying to get to the root of the problem but, if you've made a lot of changes to your UI then you've lost all your work and doing this sort of thing twice can be very dull. What we need is a way backup your work in case of emergency.
As it turns out Visio automatically saves the current state of the UI to a file each time it shuts down. It's called 'custom12.vsu' (or 11 if you're on 2003).
In Windows XP you'll find this file under:
C:\Documents and Settings\[Username]\Application Data\Microsoft\Visio
...and for Vista, under:
C:\Users\[Username]\AppData\Roaming\Microsoft\Visio
To backup the file just right-click, copy and paste and you'll end up with a copy in the same location. Should anything unfortunate happen to your toolbars in the future, just follow these steps:
- Close any instances of Visio
- Delete the existing custom12.vsu file
- Rename your copy file back to custom12.vsu
- Restart Visio
Bear in mind that Visio only updates the file as it closes, so if you made some changes since your last backup, make sure Visio is closed before you make a new copy.
Visio's UI is pretty well behaved, particularly in 2007, but if you do have a problem then using the above method means that it's less of a pain to restore your familiar interface. This is particularly useful if you're developing you own 'UI changing' code, but it's also handy when moving to a new machine so that you can take your toolbars with you.
[UPDATE 050808 - I thought I'd just add a note on an issue I came across recently while tranfering a vsu file to a new machine. By default Visio uses a set of built-in menus and toolbars and only once a user makes changes to the UI will it create a new custom set. It turns out, though, that Visio won't even start to look for a custom set unless it thinks it has one - reasonable logic I suppose. So the steps to add an existing vsu to a new machine are as follows:
- Start Visio and add a new toolbar button to one of the toolbars (View / Toolbars / Customize).
- Close Visio - It's at this point a registry setting is added to tell Visio there's a custom UI
- Delete the existing custom12.vsu file
- Rename your copy file back to custom12.vsu
- Restart Visio
The point here is that you need to ensure Visio is looking in the right place before you add your vsu otherwise, it will be in the right place but will never get loaded as Visio won't know it's there.]