Hello,
I’m writing a code to write something into the Data Card of a file, but it doesn’t work and i don’t know why. Can anyone help me please.
The GetEnumeratorVariable returns nothing, but they are some on the data card (see image below)
Here is my code (I commented de Lock and Unlock line so that i don’t add to many version on my test Part and locked the file manualy on my computer and edited the paths and Login info to protect my company)
Sub Auschecken()
Dim myVault As New EdmVault5
Dim epdmfile As IEdmFile17
Dim epdmFolder As IEdmFolder12
Dim eVar As IEdmEnumeratorVariable5
Dim FoPath As String
Dim FiPath As String
Dim ArtNr As String
' Login
If Not myVault.IsLoggedIn Then myVault.Login "abcdef", "abcdef", "abcdef"
FoPath = "C:\abcdef\01_\1051-1100\xxxx"
FiPath = FoPath & "\" & "drucker2.sldprt"
Set epdmFolder = myVault.GetFolderFromPath(FoPath)
Set epdmfile = myVault.GetFileFromPath(FiPath)
ArtNr = "1234"
'If Not epdmfile.IsLocked Then epdmfile.LockFile epdmFolder.ID, epdmFolder.ID
Set eVar = epdmfile.GetEnumeratorVariable(FiPath) ' This comes up empty
eVar.SetVar "DT-Art.-Nr.", "Standard", ArtNr
eVar.Flush
'If epdmfile.IsLocked Then epdmfile.UnlockFile epdmFolder.ID, " "
End Sub
This is the Error VBA shows me:
Which translates to: “The file format plugin cannot process the file because a component is missing”
Thank you very much.