Visio Guy

Visio Discussions => Programming & Code => Topic started by: denismq on October 22, 2009, 02:06:33 AM

Title: Help - I need simple VBA script connecting excel cells to corresp.Visio Shapes
Post by: denismq on October 22, 2009, 02:06:33 AM
Can anybody help me with an example of how to synchronise an Excel spreadsheet to a corresponding number of shapes on a Visio drawing. I can make the database connection but the shapes do not automatically align with the cells in the spreadsheet.

I left an example of what I know in the "Power User" section " with topic "Visio Shape to Excel database not automatically synchronising."
I am an inexperienced VBA user and could use some guidance.
Title: Re: Help - I need simple VBA script connecting excel cells to corresp.Visio Shap
Post by: dmajic on October 28, 2009, 05:09:07 PM
Please define what you desire to do more clearly. For example do you wish to use data from a spreadsheet to populate a Visio drawing? Do you wish to populate an Excel database from a Visio drawing?  Both of these are relative easy to accomplish.
Title: Re: Help - I need simple VBA script connecting excel cells to corresp.Visio Shapes
Post by: aledlund on October 28, 2009, 07:08:24 PM
I believe this is the post that is being referred to

http://visguy.com/vgforum/index.php?topic=1235.0

The 'simple' script is to roundtrip excel data to a visio 2003 drawing, with excel data apparently controlling shape color....

al
:-X
Title: Re: Help - I need simple VBA script connecting excel cells to corresp.Visio Shap
Post by: denismq on November 08, 2009, 10:29:16 AM
Thanks for the replies.

I am using an office floorplan that has desk numbers supplied by the building manager.
Exporting these shapes to Excel creates a spreadsheet with the shape properties I need to control (line color etc).
I copy the shapetext field to another column that I call index.
When I use the database wizard to connect the drawing using the index field as the key the spreadsheet a connection is made.
I assumed that using the index field as the key would link each shape to the corresponding spreadsheet record.
This doesn't happen and I find I need to right click each shape and choose "select database record" to create this link for each shape.
For a few records this is  not a problem; however I have thousands and need an automated solution.

I am keen to learn how to create VBA but could use some guidance here.

Title: Re: Help - I need simple VBA script connecting excel cells to corresp.Visio Shapes
Post by: aledlund on November 08, 2009, 12:45:08 PM
You might check these facility management demos out


Web based facilities management
http://msdn.microsoft.com/en-us/library/aa140251(office.10).aspx

executive office management
http://msdn.microsoft.com/en-us/library/aa140250(office.10).aspx

I've included an exe file renamed to facilitiesmanagement.democode that used to be on the MS site.
It should unzip to four files that demo facilities mangement with visio and access.

al

Title: Re: Help - I need simple VBA script connecting excel cells to corresp.Visio Shapes
Post by: denismq on November 23, 2009, 11:45:39 PM
Hi Al,
thanks for the Reply.
It's taking me some time to work out what's happening, but I will get there.

Denis