Ruler timeline on a visio diagram

T

TSS

I have several ruler timelines(my baselines) and milestone dates on a visio
diagram. I am programatically changing milestone dates and the start and
end dates of timelines .Everything is working fine except interim timeline
marking doesnt seem to be aligned with the milestone dates even though
they are supposed to be same date.
When i select the timeline and go to "Configure interval" I see the my
dates ( which i changed through VBA) and when I click OK on the dialog box
, all the timeline markings get alligned .
Seems timeline needs to be refreshed after setting the dates or what

Please help
 
A

Al Edlund

The time line addon does not monitor for events, so to make the addon update
what you have modified you have to call it. I use something like this (this
is v2003 code)

' your module

Set objApp = Me.DrawingControl.Window.Application
Set objPage = objApp.ActivePage
Set objAddOn = objApp.Addons.Item("ts")

' updating the shape sheet for the object
' make sure that visio has stabilized the shape sheet before
running addon
Application.DoEvents
' first turn off the menu we are going to call and prime it for
a yes response
objApp.AlertResponse = 1
' call the addon (these commands are in the actions cells for
the shapes)
objAddOn.Run ("/cmd=3")
' restore the application normal responses
objApp.AlertResponse = 0

' finish what you are doing

Al
 
T

TSS

Thnaks for replying.
I tried your code but its not working for me. I dont know what I am doing
wrong.
I am accessing a visio template through MS access and this is a portion of
code to set the date

Dim VisioDoc As Visio.Document
Dim VisioApp As Visio.Application
I set intervals (start and end dates) startInterval and endInterval
and then try to change dates on ruler timelines "BSI1" and "BSI2"
Set VisioDoc = VisioApp.Documents.Open(myFileName)
VisioDoc.Pages(1).Shapes("BSI1").Cells("user.BeginDate") = startInterval
VisioDoc.Pages(1).Shapes("BSI1").Cells("user.EndDate") = endInterval
VisioDoc.Pages(1).Shapes("BSI2").Cells("user.BeginDate") = startInterval
VisioDoc.Pages(1).Shapes("BSI2").Cells("user.EndDate") = endInterval


Thanks a lot
 
A

Al Edlund

what version of visio are you using? the calls and operands are different
between v2002 and v2003, thus the caveat in my note.
al
 

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