Go Premium for a chance to win a PS4. Enter to Win


How to provide updates to VISIO+EXCEL project code, without always issuing new versions of the full project files?

Posted on 2013-06-06
Medium Priority
Last Modified: 2013-06-07
Part of my visio+excel project contains 'tools' that users can employ to gain additional effects. These tools are vba procedures, and additional tools will be added over time.

I wonder how/whether to update the project files actually held by users, between times that a new version of the project is issued.  

As a vba user, I'd like to assemble the project code in a way that is most accessible to whatever automated updating can be applied later in the project (when more skills may be available).

In terms of user perception now, the speed of response of the project code to user actions does not seem to be a big issue.

Could you:
1. Tell me if any elements of this are really a practical issue this early stage?

   --  If so, can you give some pointer urls for visio and excel?

2. Help me with this memory (if its accurate).  I think I've read David Parker as saying (roughly) ~ that a well-used method for adding code to Visio is by means of .vss files / masters ~  .  I noted the url and lost it!   (And I cant imagine how it would work.)

   --  If this memory is actually true, this suggests that scope for updating /adding code
       in visio can be somewhat different from the methods for excel?

Question by:Kelvin4
  • 3
  • 3
LVL 11

Expert Comment

ID: 39224908
Hi Kelvin,

On the Visio side, it makes sense to put code in a stencil, then call the code from shapes using, for example, the CALLTHIS function in the ShapeSheet. (ie: in an Actions cell, which defines a custom right-click menu item).

If you put VBA in a drawing/template, then every drawing made from that template has a copy of the code, which is an updating nightmare waiting to happen. With code in a stencil, you just replace the stencil. And users can get new versions of shapes too (but shapes already in drawings won't be updated, it's a 'from here on out' update as far as shapes go.)

Now if a user accidentally closes the stencil with the code, then they lose functionality, but this is fairly easy to explain.

If you have real buttons on a Visio page, then they will call VBA in the document. I think it's a bit tricky to get them to call stencil in a code--you have to add a reference to the stencil, as though it were some .dll. My experience is that this often causes crashes, but I am quoting experience from 2002 and before--I've stayed away from it since. It may be much, much better now.

Excel has a more central storage for macros, you can even make a VBA add-in, so that your VBA code is sort-of installed, and users can deactivate it under File > Options > Trust Center (or something similar.)

Hope this gets you started.
LVL 11

Expert Comment

ID: 39225001
So I went ahead and tried it out. Referencing the stencil is kind of a good thing, because Visio seems to open the stencil ahead of the drawing, then hides it. So even if the user closes the docked version of the code-containing stencil, it still stays in memory and your code works.

Attached is a stencil and document. The document references the stencil's VBA project, and makes calls to it from code-behind VBA buttons. There are also shapes that call into procedures tailor-made to be called from shapes. So you have both examples.
If the drawing is distributed to a user that doesn't have the code-stencil, then an error appears declaring that Visio "Can't find project or library", which something useful that users can tell support personnel.

Can't find project or library

Author Comment

ID: 39227261
Thanks for the exciting files! Interesting and puzzling.
I tried googling "Reference to VBA utilities.vss" and found nothing of use.

I see VBA_utilities ticked in vbe/Tools/References/

However, when I opened another quite new visio drawing file in the same visio.Application instance, I could not find VBA_Utilities in the reference list which one clicks to select new references. I use Visio 2010 Premium.

Could you point me to acquiring this reference? Then Ill try reconstructing your example.

Can I reference ONE or more stencils from a vsd file?

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 39228214
I wonder what sort of things this stencil system has been used for?
and how flexible it is.

The system seems ideal to enable me to establish a tool 'test site'
Say a new tool is needed - and we want to know how the new version1 performs..

Make Stencil: "myTesterStencil"
With initation modules "myTest1"; "myTest2"; ...
Provide buttons in visio RibbonX to open respective "myTest.." initiator procedures.


So I place version1 in a stencil and  connect it to a Visio Ribbon test button via 'myTest1', so others can test them from the Visio Ribbon.

Is that practicable?

LVL 11

Accepted Solution

Visio_Guy earned 2000 total points
ID: 39228430
I created a new drawing, then opened the stencil. After Alt + F11 to get into the VBA editor. Then I went to Tools > References and "VBA_Utilities" was right there near the top of the list.

Author Closing Comment

ID: 39228446
Great help, thank you.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question