Org Charts linked to Access Database

G

George

I have an org chart linked to Access. I have a main page with all
departments, then separate pages for each department. The chart and pages
are created using the wizrd. I have several problems and here are a few.

1. I open file it links and updates but sub pages do not update. I created
each sub page by copying shapes from main and also by creating each using the
wizard but is makes no difference. Is there a way to get all pages to update
automatically?

2. I create the file using the wizard. I save it, close Visio, reopen, and
I get an error saying the table shown in the selected shape is not present.
The table is present, there is no shape selected. If I individually select
each shape and check link or tell it to refresh, there is no problem. Any
idea what's wrong and how to fix it? This is a sporadic problem.

3. I use VBA or a VB Script to automate updates, printing and distribution.
Is there a way to programmatically command Visio to refresh shapes using
the VBA or VBS?

I have the latest Visio updates, patches and service packs. I am using
Office 3000 under Windows XP Professional.
 
C

Crack

re Q1/Q3

in vb the code
Application.Addons.Item("Database Refresh").Run ("")

refreshes all shapes on the active page, I would suggest you may try a
graphic where a shape / shapes on the main page lead to other pages. These
shapes when double clicked, activate a macro that not only activates the sub
page for viewing, but in addition, refreshes the page upon entry.

i.e
ActiveWindow.Page = "department-1"
Application.Addons.Item("Database Refresh").Run ("")
 
G

George

Some additional info I found that answers some of my questions. When using
the Wizard to create the org chart, you have to select "Hyperlink shapes
across pages" for the sub pages to update. Since doing this, I no longer
have some of the problems described.

manual manipulation is an option I am striving to omit. We do not want more
than one person changing the information, hence the reason for automation.
The option "Database Refresh" does the trick, but how can I run this command
from VBA?
 
C

Crack

if i understand your question correctly try this,
place the following macro in a module.
you can run this from the tools-> macros-> menu
alternatively,
insert < RUNADDON("MapRefresh") > in the eventdblclick cell of the
events section of a shapesheet of a shape on the page and double click the
shape.

Public Sub MapRefresh() 'unlocks shapes prior to refreshing page
Visio.ActiveWindow.DeselectAll
Application.Addons.Item("Database Refresh").Run ("")
End Sub

then twig the code to suit your requirements
 
G

George

Poifect! (With tweaking). It seems so obvious once known, but no matter
what I tried I couldn't find this or figure it out using on line help and
documentation. I think it's the .run() that I was missing.

Thanks!.
 

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