Share via


Does Macro work with TFS?

If you are using Microsoft excel,project for some times, you might find using macros really ease your daily job.
So, when come to integration excel and project with TFS, does macro still work with TFS?
In fact, you can still create your own macro to call the TFS add-in control on excel and project.

For example, you want to Publish workitems to TFS

Function refresh()
        Dim refreshButton As CommandBarControl
        Set refreshButton = Application.CommandBars.FindControl(Tag:="IDC_REFRESH")

        If refreshButton.Enabled Then
            refreshButton.Execute
        Else
            MsgBox "Refresh button not enabled!"
        End If
End Function

Function publish()
        Dim publishButton As CommandBarControl
        Set publishButton = Application.CommandBars.FindControl(Tag:="IDC_SYNC"
        If publishButton.Enabled Then
            publishButton.Execute
        Else
            MsgBox "Publish button not enabled!"
        End If
End Function

Read this blog, discuss on how to use macro code to invoke the TFS add-in controls. You also can find a list of the control tags for excel and project from the blog.