Connect or Disconnect from a Synthesis Repository/VBA

Tutorial: Connect and Disconnect from a Synthesis Repository
Below is the VBA version of the tutorial.

VBA Sub Main MyRepository Repository MyRepository.ConnectToRepository ListofProjects NameIdPair ListOfProjects = MyRepository.Project.GetAllProjects MyRepository.Project.SetCurrentProject(ListofProjects(0).ID) ProjectName String ProjectID Integer ProjectName = MyRepository.Project.GetCurrentProject.Name ProjectID = MyRepository.Project.GetCurrentProject.ID  MsgBox ( & ProjectName &  & ProjectID) MyRepository.DisconnectFromRepository End Sub