Macro opening the latest version of a file in the vault PDM

Hi everyone,

We are trying to create a macro opening excel file in PDM store based on the latest version . At the moment we have done in excel macro opening the file in the store :

Sub openfile()

Const sciezka\$ = "C:\Company\Template\Company\Calculation\"

Dim wkb1 As Workbook: Set wkb1 = Workbooks.Open(path & "Workbook.xls")

Dim wks1 As Worksheet: Set wks1 = wkb1.Sheets("NameOfWorksheet")

ActiveWindow.Close

wks1.Select

End Sub

I ask for advice on what commands to mount in the macro opening the file in the latest version.

Best regards

SolidworksApi macros