1 Reply Latest reply on Jun 1, 2018 10:17 AM by Ulf Stockburger

    Add excel file to Epdm with VBA

    Enrico Camusso

      Hi,

      hi try to make a new vba macro in Solidworks to add a excel file in to Epdm

      I cant use vb.net but only VBA

       

      Sub LoginToVault()

       

           Dim eVault As IEdmVault13

          Set eVault = New EdmVault5

          Call eVault.LoginAuto("Inpeco", 0)

      End Sub

       

      Sub prova()

      Dim filename As String

      Dim folder As IEdmFolder8

       

      filename = "\\inpeco.com\dfs\R&D\Mechanical R&D\HW Mec\Fogli di calcolo\Master Template.xlsm"

      Call LoginToVault

      Dim boolstatus As IEdmObject5

       

      Set folder = eVault.RootFolder

      files.mbsPath = filename

       

      Set boolstatus = folder.AddFile2(0, files.mbsPath, "")

       

      End Sub

       

      But dont work, please can you help me???

      Thank in advance

        • Re: Add excel file to Epdm with VBA
          Ulf Stockburger

          Hi Enrico

           

          Try this.

          Dim eVault As IEdmVault13
          Sub LoginToVault()
              Set eVault = New EdmVault5
              Call eVault.LoginAuto("Inpeco", 0)
          End Sub
          Sub prova()
              Dim filename As String
              Dim folder As IEdmFolder8
              Dim errorC As Long
              filename = "\\inpeco.com\dfs\R&D\Mechanical R&D\HW Mec\Fogli di calcolo\Master Template.xlsm"
              Call LoginToVault
              Dim boolstatus As IEdmObject5
              Set folder = eVault.RootFolder
              folder.AddFile2 0, filename, errorC
          End Sub
          

           

          BiI SAP-PDM