News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

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

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 228 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1081KB.
Tokens: post-login.
Cache hits: 13: 0.00152s for 26,745 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]