Does EPDM2011 API support VBA or is VB.NET required?
I don't see why not as I have used VBScript and PHP. Anything that can use COM should work.
To be totally clear, you're saying that EPDM API can be programmed from VBA?
Thanks, Lee. I appreciate your help.
A little curious about your vbscript solution. I have done a number of things in VBS and have never tried EPDM, but always imagined a challendge would be the windows handle. How did you approach that challenge? If you don't mind answering...
I didn't need to use any methods that required a window handle. My first guess would be to pass nothing or use the Win32 API to get the handle.
After considerable searching and several dismal attempts to connect to the EPDM API I've been forced to conclude that it does not in fact support VBA.
I'd like to be able to perform some simple vault tasks from an Excel macro, but it just isn't possible.
Oh well... I'll have to find another way.
Come on Brian where is that "go to" spirit?!
I use Excell all the time to integrate with EPDM, SW macros too. I'll grant there some some things that I can't get to work in VBA (that revision manager object is stupid), but most commands work without any problem.
Heck look at Office2PDM, that is doing a ton of stuff in Excel, Word and Outlook.
I'm ready give me a challenge. Gimme an example of something you cannot do in Excel.
OK, Jeff... you asked for it
If I could read and set datacard variables that would be a great start. Creating and deleting file references would be smashing, also. Those two things would be about 95% of what I want right now.
Please find the attached XLS file. I've hard coded all file names, the vault name and assumed the file is checked out, but I hope it is a good proof of concept for you?
First thing to check is to ensure your Excel was able to find the EPDM reference, if not, fix it before trying.
Ah, well... I stand corrected; and very pleased! The code you posted works well and I got it working with only minor adjustments (you referred to IEdmFolder7 and my version of the library only goes to IEdmFolder6, but it was an easy fix).
I've only played with the reading variables part, but it seems from the code that it may be reading directly from the file, which is OK for Solidworks files, but I don't know if this is going to work if I'm looking for variables of other file types, such as xlsx... In particular I noticed that the GetVar method requires the inclusion of the configuration, but of course this would not be relevant to a non-SolidWorks file. What would you suggest for dealing with them?
Pass an empty string.
 For files that do not support a configuration, pass an empty string. ("", String.Empty, whatever). e.g. varEnum.GetVar("varName, "", val) [/edit]
Thanks, Lee... I'll give that a shot!
Retrieving data ...