automatic refresh of linked shapes

P

PF

Hi all,

I have a drawing in visio which is linked to a database.

I want the drawing to change when the database change.

I am using a mdb database with odbc driver.

I select automatic update each five seconds.

But it is not working.

To update, i have to select a shape then run the add-on refresh database.

am i missing somtehing?

Is it possible to do auto refresh?

Is there a way to have a timed events that will execute the regresh command
in vb code?

regards,

pierre
 
A

Al Edlund

This from a previous submitter...
Al


From Page 759 of Microsoft Visio Version 2002 Inside and Out book.



1) Tools / Macros/ Visio Extras / Database Wizard

2) Click Next

3) Select "Create A Linked Drawing or Modify An Existing One", and click

Next

4) Select "Add Database Actions And Events To a Drawing Page", and click

Next

5) Choose your Visio Drawing and page

6) Check the "Refresh linked shapes on document open", and click Next

7) Click Finish



I tried this out a while back and was disappointed because you have to do

this for every page that contains a linked shape and my visio document

contained more than a hundred pages. So wrote a macro that loops through

all pages refreshes them with the database. I'm sure there is a way to make

the macro run when the document opens although I don't know what it is off

hand. Hope this helps.





' DatabaseRefresh

'

' This macro loops through all pages of your visio document and

' performs a Database Refresh by executing the Addon for refreshing

' the database ("Database Refresh").

Public Sub DatabaseRefresh()

Dim pg As Visio.Page

Dim OriginalPg As Visio.Page



' Record the original page

Set OriginalPg = ActiveWindow.Page



' Loop through each page of the document

For Each pg In ThisDocument.Pages



' Set the page to be the active page

ActiveWindow.Page = pg.Name



' Execute the "Database Refresh" Addon

Application.Addons("Database Refresh").Run ""



' Increment the page counter

Next pg



' Set the active page back to the original one so the

' user doesn't end up on the last page

ActiveWindow.Page = OriginalPg.Name



End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top