Help - I need simple VBA script connecting excel cells to corresp.Visio Shapes

Started by denismq, October 22, 2009, 02:06:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

denismq

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.

dmajic

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.

aledlund

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

denismq

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.


aledlund

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


denismq

Hi Al,
thanks for the Reply.
It's taking me some time to work out what's happening, but I will get there.

Denis