Just off the 2010 track for a second, this is a quick post in response to a newsgroup question about how to link size data, in a spreadsheet, to the shapes in a Visio 2007 document. (Note that the Link data to shapes functionality is only available in Visio 2007 Professional.)
Walkthrough – Excel
- Create your data in Excel making a note of the column names – I’ll come back to this in a moment.
- Optionally, you can select the table you’ve created and define a named range as follows:
3. Save and close you workbook.
Walkthrough – Visio
Note – I’m basing this on the ‘Process’ master shape in the Basic Flowchart stencil, but the principle is the same for any master based shape whether you create one yourself or use an existing one.
- Open Visio and click File / New / Flowchart / Basic Flowchart to create a new document.
- Drag a new ‘Process’ shape on to the page and delete it (this creates a new master in the document stencil).
- Click File / Shapes / Show Document Stencil and double click the Process master you find there to edit it.
- Select the master shape that’s now opened and click Window / Show ShapeSheet (see this Just for starters post for an introduction to the ShapeSheet).
- Scroll down to the ‘Shape Data’ ShapeSheet section and right click on one of the existing row names to select Insert Row from the context menu.
- Repeat item 5 and edit the last two rows so that they appear as follows (the important thing to notice here is that the Label values must match the column headers that you used in the spreadsheet):
- Move back up the ShapeSheet to the ‘Shape Transform’ section and edit the Width and Height formulae as follows:
- Close the ShapeSheet and click ‘Yes’ to the ‘Update Process?’ dialog.
- Now select Data / Link data to shapes… , and select the Excel workbook you created earlier using the first two screens of the wizard.
- In the third screen of the wizard, select the Named range that you created in Excel, followed by the Finish button to exit the wizard. (Note you can of course click next to modify the default settings.)
- You should now be returned to the main window in Visio with the following External Data window visible at the bottom:
- Select all of the External Data rows (click one and then press Ctrl+A) and drag the selection on to the page.
- This will drop a set of shapes, based on the selected master (in this case there’s only one anyway), on to the page including all of the linked data.
- By default the linked shapes have Data Graphics applied to them, so while they’re all selected, just click the ‘None’ option in the task pane on the right and these will be removed:
Linking data to shapes can be a lot more than just automatically adding labels to shapes and there’s a great example of this over at the Visio Insights blog here.