Solved

How do I populate fields in a visio diagram from an Excel worksheet?

Posted on 2008-06-13
2
1,417 Views
Last Modified: 2012-08-14
I have created a printable Visio diagram that has a variety of text boxes scattered throughout that contain numbers. These numbers change over time, and I need to subsequently change the Visio diagram accordingly. However, I was wondering if there was a way to connect the values from certain fields in an Excel spreasheet to what is displayed on the Visio diagram, as the Excel spreadsheet is where these values are being changed. If I can do this, I merely change the spreadsheet, and then I can print an updated Visio diagram that reflects those changes.
Any ideas on how to do this?
0
Comment
Question by:plandau
2 Comments
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 125 total points
ID: 21791714
To set or establish the name of a text box:

Right click : format : special.

Modify the box names in column 1 to reflect your own box names and the box text dtrings in column D to reflect the new text to be used ... use a copy of your visio file as a test sequence.

Chris


    For shapeCount = 1 To ThisWorkbook.Sheets(1).Range("A" & ActiveSheet.Rows.Count).End(xlUp).Row
'        visdoc.Pages(1).Shapes(ThisWorkbook.Sheets(1).Range("A" & shapeCount).Text).SetCenter ThisWorkbook.Sheets(1).Range("B" & shapeCount).Value, ThisWorkbook.Sheets(1).Range("C" & shapeCount).Value
        visdoc.Pages(1).Shapes(ThisWorkbook.Sheets(1).Range("A" & shapeCount).Text).Text = ThisWorkbook.Sheets(1).Range("D" & shapeCount).Text
    Next

Open in new window

deleteme1.xls
0
 
LVL 30

Expert Comment

by:Scott Helmers
ID: 21794741
If you'd like an alternative that doesn't require programming, Visio 2007 Professional allows you to link shapes on a page to data in Excel quite easily. And once you've established the link, you can update the drawing manually or at a preset time interval.

Microsoft calls the feature "data linking" and includes some useful content on their web site:

-- demo: http://office.microsoft.com/en-us/visio/CH100740891033.aspx (see first demo)

-- tutorial: http://office.microsoft.com/en-us/training/CR101109221033.aspx (four tutorials on linking)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

The ability to add structure to Visio diagrams using containers, lists and callouts is one of my favorite features in Visio 2010. In this article I’ll describe a mashup of containers and lists that meet a real-world need. Prior to reading this ar…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

776 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