I work a lot with layers in Visio, and written an add-in, LayerManager, to assist, but I was asked an interesting question recently: How can shapes by assigned to layers automatically from a list in Excel? So, I thought I would present my solution. This particular request was for a Timeline diagram, where the Milestone shapes are to be on specific layers. So, I just used one of the samples provided with Visio.[Read more…] about Assigning Visio Shapes to Layers from Excel Table
So, I have created some macros to provide quick and easy selection, positioning and updating of images within a group shape.
[Read more…] about Replacing Images in Visio Shapes by Changing Data
I decided to present this article with VBA code rather than my preferred C# so that a stencil could be downloaded to provide instant usability, rather than having to install an add-in. It can be download from Image Utils.vssm, and should then be placed in to My Shapes folder, so that it becomes available to open in Visio. When it is opened, then the macros will need to be enabled.
There are just five public macros:
Visio is an enormous application with literally millions of lines of code, so it is inevitable that bugs creep in for time to time, and can lay dormant .. until you really need it! Such an incident happened to me during a project for a large organisation where the latest and greatest build and versions are held up by the internal IT departments until they are sure that there is absolutely nothing hidden inside. In this project, I was given a laptop with Visio Pro for Office 365 to work with … not a problem, even though that moniker already told me that this was a seriously out of date edition, since it has been called Visio Online Plan 2 for quite a while. Anyway, I developed a solution that relies heavily on linked SharePoint lists and document libraries, using a view. The automatic name of these views are very verbose, so I consistently renamed them. Also, I had the same SharePoint Document library view linked more than once, so that I could link multiple rows to shapes, so renaming was, and is, absolutely essential. Several weeks went by, and my solution was working fine, until one day last week, my colleague told me that the Data / Refresh All was failing for him, and for other users. A review of his laptop showed that his Visio version had been updated to build 1708 from 1609 and the refresh was reverting the carefully renamed data recordsets back to the underlying SharePoint view name. My own personal laptop, not the client’s, is at build number 1808, so I will get the real fix from Microsoft soon via the normal channel updates for Click-to-Run.
[Read more…] about Temporary Fix for Data Refresh in Visio Click-2-Run
Well, this was disastrous, so I contacted the Microsoft Visio product team to report the issue immediately, stressing the urgency, and using my MVP credentials, of course. They quickly located the bug and fixed in internally, and it will be rolling out soon in the normal manner. There response was absolutely fantastic, and I would like to publicly thank them for reacting so effectively. However … the fix will not help for a while on this particular customer site as they are only just rolling out updates from a year ago! So, in the meantime, I have a problem, and possibly others out there in the wild may have a problem, but not yet realised it. Therefore, I have written some very simple macros that are activated by dragging and dropping one of two shapes onto a page, or from the macros ribbon button, in order to do the refresh, either for the active recordset in the External Data window, or for all data recordsets in the document. They simply get hold of the current name, refresh the recordset, and re-apply the name. Finally, the shapes delete themselves, and the master in the document.
The code is quite short and simple, and called by the drop event of the shapes, using the ShapeSheet formulas
My first introduction to the art of Visio development was provided by David Edson, M.Arch. MCP. back in 1996 in Paris. Visio Corporation parachuted him and Mark Davision into that beautiful city to spread the knowledge with a week of intensive ShapeSheet and automation training. Dave was inspirational, and that week set the course for the rest of my life. His enthusiasm for the smartness of Visio and his similar background to my own, as an architect, meant that we immediately connected and understood each other. I stayed at his self-designed house in the woody hills near Seattle in the early days, and he has stayed with me in the England, though I know he would have preferred that it was Scotland, the land of his forefathers.
Dave wrote many books and articles about Visio, and created many videos, so he will live on in the ether for a long time, but many will remember his effortless presentations enthusiastically describing how to make smarter diagrams.
Here is an early example of his work, a simple Back Gammon game, that he created to demonstrate the capabilities of Visio with some VBA code.
Dave was also a great photographer, and connoisseur of single malt whisky, but it will be for his belief in Visio that he will perhaps be best remembered. I recommend that all Visio users worldwide visit his website and download all of the free resources that he provided : (no longer available)
Gus am bris an là – David A. Edson
I was going to do a full post on the special Legend shape in Visio that can automatically count instances of masters on a page, then I found that my good friend Chris Roth, aka VisGuy, had done one some years ago ( see visguy.com/…/legend-shapes). However, I have some extra information that will assist in getting the functionality to work consistently.
Basically, you can make any Master work with the Legend shape by adding the User.visLegendShape = 2 setting into a Master shape, but there are caveats.
- If the name of a Master is changed, then any existing shapes on the page must be re-placed
- The BaseID of each Master must be unique
- If the BaseID is changed (using NewBaseID), then any existing shapes on the page must be re-placed
To demonstrate this, I used the Good and Bad icon shapes from the Legend Shapes stencil.[Read more…] about More secrets of the Visio Legend shape
This article describes how to open a Microsoft Access form at a specific record from a Visio shape. I was an Access developer before I was a Visio developer, and both of the applications have VBA to provide tactical solutions for everyday tasks. Fortunately, it is fairly simple to copy the VBA code from one application to another…
[Read more…] about Opening an MS Access form from a Visio shape
Firstly, I am assuming that both of the desktop applications are open, and although Visio shapes can be linked to Access queries and tables, it is not essential for this solution.