I don't have much to test with here, but you're going to need to include some EPDM API into your macro and as I recall you have to do something special to add the libraries. It's named "PDMWORKS Enterprise 2015 Type Library" and you can get instruction on how to add it from here VBA Excel: Reference Libraries in Excel WorkBook. After you add that you'll need a few things, add the vault as an object:
Dim vault As Object
Then login to it (will prompt you to login if you're not, otherwise uses your credentials)
Set vault = CreateObject("ConisioLib.EdmVault")
vault.LoginAuto "Insert Name of Vault Here", 0
Then get a file and rename it
Dim File As Object
'Get the interface of the file (and its parent folder)
Dim Folder As Object
Set File = vault.GetFileFromPath("Insert Full Path to File Here", Folder)
File.Rename Application.Hwnd, "Insert New Name Here"
I hope that works for you, Excel macros are disabled here so I can't really test.
I have the same problem, I used your code, but I need to unlock the file before, and lock after.
Can you explain to me the good way ?
Thanks a lot.
That's odd, not sure which file you're referring to. It may throw a fit if you try to rename a file that has references in where used that are checked out.
Dispatch does a good job of renaming files in batch if you don't want to go through all of the custom API. It can pull any data card variables and apply them to the file name for instance.
What are you wanting to rename the files to? That would help define what the tool needs to do. If you're simply renaming them a different name that could all kinds of different values, then doing a search and simply RMB > Rename (or F2 on the file) will allow you to rename it in the vault.
I need to create many files (with macro vba, and from a model to have the good data card variables), and rename it, after I would like to lock this new files in the vault.