Using SharePoint Calendars with Visio Timelines

I was recently asked if it is possible to use SharePoint calendars with Visio Timeline Shapes automatically.  My first reaction was “not without code”, but a closer inspection reveals that you can use Visio 2007 Professional Link Data to Shapes quite easily….

Firstly, I found the WSS Demo site to be useful.

In Visio 2007 Professional, you can use Data / Link Data to Shapes … to get data from Microsoft Windows SharePoint Services:


Then enter (or your own) as the Site.


And login of course, in this case the password is pass@word1.


Then select the Calendar list:


Now, you need to rename the Title, Start Time and End Time columns by selecting Column Settings …  on the right mouse menu of the External Data window…


.. to Task Name, Start and Finish .  This is important, because this will be used to match the values from the calendar to the shape properties.


Drag and drop a Timeline shape, and set the Start and Finish to your requirements….


Then, select an Interval shape in the stencil, and drag a row from the External Data window, and drop it on the page (not over the Timeline itself). The Configure Interval dialogue will popup, which you can just OK.


In addition to the three columns that we previously mapped, all of the other columns will be automatically added as  extra Shape Data rows on each shape.


Of course, you can use Milestones or Intervals….



Post script:

The sample data happens to include hyperlinks as text, but you can ensure that Visio interprets them as real hyperlinks by checking the Hyperlink box on the Types and Units dialogue opened from the Data Type… button on the Column Settings dialogue.


You will then get hyperlinks on your shapes!  And you can have multiple ones per shape!


Ye gads … Visio is cool!

Posted in Visio. 4 Comments »

4 Responses to “Using SharePoint Calendars with Visio Timelines”

  1. Mateusz Orłowski Says:

    Works fine but if you change a date in SharePoint calendar, the new date will not be displayed in visio drawing.
    Perhaps you have an idea how to fix it?

  2. davidjpp Says:

    Hmm, I see what you mean. Try this macro after you refresh from the wss:

    Public Sub UpdateStartEnd()
    Const startProp As String = “Prop.visIntervalBegin”
    Const endProp As String = “Prop.visIntervalEnd”
    Dim shp As Visio.Shape
    Dim pag As Visio.Page
    Dim iRecord As Integer
    Dim dataRecordsetIDs() As Long
    Dim dataRecordset As Visio.dataRecordset
    Dim customPropertyIndices() As Long
    Dim dataColumn As Visio.dataColumn
    Dim dataRow As Long
    On Error GoTo errHandler
    Visio.Application.EventsEnabled = False
    For Each pag In Visio.ActiveDocument.Pages
    For Each shp In pag.Shapes
    If shp.CellExistsU(startProp, Visio.visExistsAnywhere) _
    And shp.CellExistsU(endProp, Visio.visExistsAnywhere) Then
    shp.GetLinkedDataRecordsetIDs dataRecordsetIDs
    For iRecord = 0 To UBound(dataRecordsetIDs)
    If shp.IsCustomPropertyLinked(dataRecordsetIDs(iRecord), _
    shp.Cells(startProp).Row) Then

    Set dataRecordset = Visio.ActiveDocument.DataRecordsets( _
    Set dataColumn = dataRecordset.DataColumns( _
    shp.GetCustomPropertyLinkedColumn(dataRecordsetIDs(iRecord), _
    dataRow = shp.GetLinkedDataRow(

    If dataRecordset.GetRowData(dataRow)(shp.Cells(startProp).Row) _
    shp.Cells(startProp).ResultStr(“”) Then
    shp.Cells(startProp).Formula = _
    “=DATETIME(“”” & dataRecordset.GetRowData(dataRow)(shp.Cells(startProp).Row) & “””)”
    End If
    End If
    Next iRecord
    End If
    Next shp
    Next pag

    Visio.Application.EventsEnabled = True
    End Sub

  3. Mateusz Orłowski Says:

    David, thanks for your reply. The problem is not in Visio 2010 itself – it refreshes start and finish without macro help. The drawing within SharePoint site (.vdw) doesn’t “see” the changes to Start and Finish columns. Macro will not work in this case because as far as I know macros are not supported.

  4. Visio Services links « John Palmer @ Citrius Says:

    […] Using SharePoint Calendars with Visio Timelines […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.


O365 and SharePoint

Simplify Tasks

Want to learn the simple way?

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

John Goldsmith's visLog

be smart, be clear, be visual ...

Mo's blog

Personal views on Dynamics 365 for Operations and Technical Architecture.

Chris Webb's BI Blog

Microsoft Power BI, Analysis Services, MDX, DAX, M, Power Pivot and Power Query

Azure Solutions for Office 365, and more...

Rob Fahrni



Life with Visio and other Microsoft Toys!

Nilsandrey's Weblog

Just another weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Smart graphics for visual people

%d bloggers like this: