• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

bVisual

  • Home
  • Services
    • How Visio smartness can help your business
    • Visio visual in Power BI
    • Visio Consulting Services
    • Visio Bureau Services
    • Visio Training and Support Services
  • Products
    • Visio Shape Report Converter
    • SS Plus
    • LayerManager
    • visViewer
    • Metro Icons
    • Rules Tools for Visio
    • The Visio 2010 Sessions App
    • Multi-Language Text for Visio
    • Document Imager for Visio
    • multiSelect for Visio
    • pdSelect for Visio
  • Case Studies
    • Case studies overview
    • Using Visio in Education for GIS
    • Visualizing Construction Project Schedules
    • Visio Online Business Process Mapping
    • Nexans Visio Template
    • CNEE Projects, WorldCom
    • Chase Manhattan Bank
  • News
    • Recent news
    • News archive
  • Resources
    • Articles➡
      • ShapeSheet Functions A-Z
      • Comparing Visio for the Web and Desktop
      • Customising Visio Shapes for the Web App
      • Key differences between the Visio desktop and web apps
      • Using the Visio Data Visualizer in Excel
      • Using Visio in Teams
      • Creating Visio Tabs and Apps for Teams with SharePoint Framework (SPFx)
      • Designing Power Automate Flows with Microsoft Visio
      • Innovative uses of Visio Lists
    • Webcasts ➡
      • Visio in Organizations
      • My session and other Visio sessions at MSIgnite 2019
      • Power up your Visio diagrams
      • Vision up your Visio diagrams
      • The Visio 2010 MVP Sessions
    • Visio Web Learning Resources
    • Books➡
      • Visualize Complex Processes with Microsoft Visio
      • Mastering Data Visualization with Microsoft Visio
      • Microsoft Visio Business Process Diagramming and Validation
      • Visualizing Information with Microsoft Visio
  • Blog
    • Browse blog articles
    • Visio Power BI articles
    • Visio for Web articles
    • A history of messaging and encryption
  • About us
    • About bVisual
    • Testimonials
    • Bio of David Parker
    • Contact Us
    • Website Privacy Policy
    • Website terms and conditions
    • Ariba Network

Coding

Published on April 20, 2008 by David Parker

Setting Visio Shape Cell Values By Connections

A recent newsgroup poster asked me to explain how to set the line color and weight of a connector according to the shapes it is connected to.  So, in this article, I have tried to explain one method of achieving this with minimal external coding.

In this example, I have created a rectangle shape that has a single Shape Data row, MyData, which has a fixed list of values, A;B;C.

The connector shape has been modified to trigger an event whenever a connection is made or unmade.  If the user successfully connects two rectangles with the same MyData value, then the line (weight and color) of the connector shape is amended to match the rectangle shapes.

image
[Read more…] about Setting Visio Shape Cell Values By Connections

Filed Under: Connections, Connectors, VBA, Visio

Published on December 10, 2007 by David Parker

Creating PolyLines From Existing Shapes in Visio

A couple of posts in the Visio newsgroups got me thinking this weekend.  One was from an Autocad conversant user who would prefer Visio to draw a continuous line between points rather than doing the normal click, hold and drag with line tool because he has tendonitis; and the other wanted to draw a circle centered on a vertex because he is drawing land boundaries.

Visio has a PolyLine line type, but, as far as I am aware, it can only be created in code – there is no menu or toolbar button to enable you to use it.  It was introduced for converting CAD lines, and is simply a series of X and Y co-ordinates in a single cell, rather than the normal co-ordinate per row.
[Read more…] about Creating PolyLines From Existing Shapes in Visio

Filed Under: ShapeSheet Formulas, VBA, Visio

Published on November 11, 2007 by David Parker

Finding a Row in a Visio DataRecordset

A recent newsgroup post asked how to find a row in a Visio DataRecordset for a given criteria.  Well, I have used the IT Asset Management sample in Visio 2007 Professional to demonstrate how this can be done with a VBA function.

Of course, you may wish to improve the user interface because I limited myself to using an InputBox, and I have assumed that there is only one column defining the primary key of the DataRecordset.

The sub function, FindRow, listed below first checks whether the External Data window is open, and then gets the active DataRecordset.  The code then reads the columns of the DataRecordset and prompts for a selection of the number of the column that you wish to search for a value in.

image
[Read more…] about Finding a Row in a Visio DataRecordset

Filed Under: External Data, VBA, Visio

Published on October 27, 2007 by David Parker

Displaying Document Fonts

There have been some posts recently about fonts may not displaying correctly in Visio, the Viewer, or in exports to PDF or XPS.  So, I thought it would be good to be have a bit of code that enables you to see all of the different fonts on a Visio page.  You can then use it to select a font, or to check how they are seen in different formats.

image
[Read more…] about Displaying Document Fonts

Filed Under: VBA, Visio

Published on October 8, 2007 by David Parker

Toggling Layers On and Off

UPDATE March 2017 : I have now expanded this functionality into an add-in for Visio (see Layer Manager add-in for Visio released ).

Visio layering system is more complex than any CAD system I’ve worked with, and often catches users out.  A Visio shape can belong to no layer, one layer or multiple layers simultaneously, and a layer can be visible or invisible; printable or non-printable.  In fact, you can have a shape on a layer that is invisible but printable – a good way to put a watermark across a document.

Firstly, Visio layers are per page in a document, and secondly, Visio layers are stored as an index number with an associated name.  Therefore, layer 1 on page 1 could be named Outline, but layer 1 on page 2 could be called something completely different!

View > Layer Properties will show you the layer settings on the active Visio page, but the # column, which gives you a count of shapes on each layer, can be misleading because the same shape can be on multiple layers, and even sub-shapes (those inside a grouped shape) are counted.

image
[Read more…] about Toggling Layers On and Off

Filed Under: Layers, VBA, Visio

Published on June 18, 2007 by David Parker

EventXFMod can cause Visio to stop working

I was recently re-working with some old code of mine that enhanced the Cross Functional Flowchart template, and found that it can cause Visio to stop working when the VBA project is enabled. Let me explain the problem, and the solution that I have adopted.
Firstly, I should say that this is VBA because it is for occasional use only, otherwise I would go to the trouble of making an add-in.
I modified the Flowchart shapes master by entering a formula in the EventXFMode cell:
=CALLTHIS(“GetFunction”,””)
This caused the GetFunction sub to be called whenever the shape was moved (in this case to detect the Functional band that it lay within).
This was working fine until the number of pages and shapes increased, and what I found was that, although it continued to work whilst the document was open, it caused Visio to stop working when the document was opened and the VBA project enabled. This always occurred whilst Visio was busy processing all of the shapes. It seems that my GetFunction sub was conflicting with whatever the Microsoft Cross Functional add-on and the Visio routing engine was up to.
I decided that the simplest solution would be find a way of filtering the firing of my GetFunction sub, and the easiest way to do this was to add a User-defined cell in the document, called MonitorShapes, and to only call my sub if the value in that cell is not zero, by using the modified formula in the EventXFMod cell:
=IF(TheDoc!User.MonitorShapes,CALLTHIS(“GetFunction”,””),0)
Of course, I then need sub to set this value to 0 or 1.
Public Sub StartMonitorShapes()
    If ThisDocument.DocumentSheet.CellExists("User.MonitorShapes", Visio.visExistsAnywhere) Then
        ThisDocument.DocumentSheet.Cells("User.MonitorShapes").Formula = "1"
    End If
End Sub
Public Sub StopMonitorShapes()
    If ThisDocument.DocumentSheet.CellExists("User.MonitorShapes", Visio.visExistsAnywhere) Then
        ThisDocument.DocumentSheet.Cells("User.MonitorShapes").Formula = "0"
    End If
End Sub
The result is that Visio no longer stops working when I open the document, as long as I remember to run StopMonitorShapes before I save and close it.

Filed Under: ShapeSheet Formulas, VBA, Visio

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 8
  • Page 9
  • Page 10

Primary Sidebar

  • LinkedIn
  • Twitter

Recent Posts

  • Fixing dimensions of 2D shapes
  • Merging Linked Data from Similar Tables
  • Smart Radio Buttons and Check Boxes in Visio
  • Using Button Face Ids in Visio
  • Grid Snapping Revisited

Categories

Tags

Accessibility Add-Ins Connectors Containers Data Export Data Graphics Data Import Data Visualizer Educational Excel GraphDatabase Hyperlinks Icon Sets JavaScript LayerManager Layers Legend Link Data to Shapes Lists MSIgnite MVP Office365 Org Chart PowerApps PowerBI PowerQuery Processes Setup and Deployment Shape Data Shape Design ShapeSheet ShapeSheet Functions SharePoint 2013 SQL Teams Validation VBA Video Visio Visio 2007 Visio for the Web Visio Online Visio Services Visio Viewer Webinar

Footer

bVisual Profile

The UK-based independent Visio consultancy with a worldwide reach. We have over 25 years experience of providing data visualization solutions to companies around the globe.

Learn more about bVisual

  • Amazon
  • E-mail
  • Facebook
  • LinkedIn
  • Twitter
  • YouTube

Search this website

Recent posts

  • Fixing dimensions of 2D shapes
  • Merging Linked Data from Similar Tables
  • Smart Radio Buttons and Check Boxes in Visio
  • Using Button Face Ids in Visio
  • Grid Snapping Revisited

Copyright © 2025 · Executive Pro on Genesis Framework · WordPress · Log in