Visio Guy

Visio Discussions => Programming & Code => Topic started by: SubPlanner on December 07, 2015, 08:14:10 PM

Title: How do I linkup the Begin and End Timlines dates to another timeline?
Post by: SubPlanner on December 07, 2015, 08:14:10 PM
I am attempting to linkup the Begin and End dates of a basic line timeline from Page-1 to a master page that contains what I would like to call the master timeline.

I would like to create multiple pages and link timelines on those pages to one master page.



Thanks for any help you can offer.

SubPlanner
Title: Re: How do I linkup the Begin and End Timlines dates to another timeline?
Post by: SubPlanner on December 08, 2015, 01:43:39 PM
Update Info: I am using V2010 Pro version.

Thanks for any help.


SubPlanner

Title: Re: How do I linkup the Begin and End Timlines dates to another timeline?
Post by: Paul Herber on December 08, 2015, 03:27:16 PM
The operation of timeline shapes is under the control of a built-in addin, and it seems that playing with the stored values for the start and end dates for a timeline get overwritten by the addin.
Title: Re: How do I linkup the Begin and End Timlines dates to another timeline?
Post by: SubPlanner on December 08, 2015, 03:36:36 PM
That sound about right. So we can read shape data from page to page but not date info from one timeline to another?

I was hoping for a way to make this work cuz I would hate to have to rebuild this for multiple pages.

Thanks for your Help.

SubPlanner
Title: Re: How do I linkup the Begin and End Timlines dates to another timeline?
Post by: Paul Herber on December 08, 2015, 04:25:31 PM
Reading it isn't a problem, the problem is putting a formula into the receiving shape, it just gets overwritten.
Title: Re: How do I linkup the Begin and End Timlines dates to another timeline?
Post by: dasjoos on December 15, 2015, 02:31:29 AM
I've had luck writing the dates to the user.visBeginDate and user.visEndDate fields with VBA. It does write the datevalue to the correct place. However, the timeline doesn't always visually update...but if you right-click on the timeline, select Configure Timeline..., then just click OK, it updates (the dates are pre-populated and the timeline behaves correctly otherwise, but doesn't update visually until you open the dialog).

   
    serialStart = Format(startdate, "00000")                    'get the serial date...this is what the timeline likes
    serialEnd = Format(enddate, "00000")
                                           
    Set vsopage = Application.ActiveWindow.Page
    Set tlShape = vsopage.Shapes.ItemFromID(1)                                   'set the timeline shape
    Set modcell1 = tlShape.CellsSRC(visSectionUser, 1, visUserValue)             'set the shapesheet start date box to edit
    Set modcell2 = tlShape.CellsSRC(visSectionUser, 2, visUserValue)             'set the shapesheet end date box to edit
   
    modcell1.FormulaU = serialStart                                            'edit the start date box
    modcell2.FormulaU = serialEnd                                             'edit the finish date box
Title: Re: How do I linkup the Begin and End Timlines dates to another timeline?
Post by: SubPlanner on December 15, 2015, 01:54:10 PM
Thanks for the updates.
I ended up writing a series of macros that does it all for me. I launch from a button on a separate page. This as a continuous vba string with code at the end of each macro to call the next step.
Here's what I did:
Macro1: Create a new tab.
Macro2: Drop a master timeline onto the new tab, place it directly over the location of the current master timeline depicted from the background. Drop a start milestone and an end milestone and link the timeline start and end  dates to the milestones.
Macro3: Drop another timeline onto the page and link the start and end dates to the master timeline as well as pinning the BeginX and EndX to the master timeline.
Macro4 thru Macro10: same as Macro3. Just adding 9 more timelines.

I left the timelines blank, so that when you drop milestones on them, they will line up with the master at the top of the page.

I have a template as a background that displays a master timeline for visualizing the date range on any added pages.

I can post the working example of this if there is any interest.

SubPlanner

Browser ID: smf (is_webkit)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 1: index+Modifications.english (default).
Style sheets: 0: .
Hooks called: 58 (show)
Files included: 25 - 925KB. (show)
Memory used: 773KB.
Tokens: post-login.
Cache hits: 6: 0.00098s for 22,291 bytes (show)
Cache misses: 1: (show)
Queries used: 8.

[Show Queries]