Hi Group, Here is a question. AutoCAD 2000. When I bring up the VBA Manager dialog and add a new project, I notice that a reference to "Visual Basic for Applications" is added automatically. I can only see a partial path to the referenced libray. I see C:\Program Files\Common Files\Microsoft Shared\VBA\VBA332.... Additionally, if I scroll down the list of references, I can see other libraries which aqre also identified as "Visual Basic for Applications". The paths to these are; C:\WINNT\SYSTEM32\MSVBVM50.DLL C:\WINNT\SYSTEM32\MSVBVM60.DLL C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\vt...... C:\WINNT\SYSTEM32\VBAEND32.OLB C:\WINNT\SYSTEM32\VBAEN32.OLB C:\WINNT\SYSTEM32\VEN2232.OLB Now, I want to use a function called Split from a VBA library. Basically, it turns a string into an array of strings. At least the documentation says the function is a VBA function. Looks like it resides in MSVBVM60.DLL. Right now my AutoCAD application is finding an AutoCAD method "split" which has to to with viewports. When I try to uncheck the reference to "Visual Basic for Applications" which AutoCAD placed there, I get an error, "Cannot remove". When I try and add a reference to MSVBVM60.DLL, I get the error "Already in use....". So my question is how do I get the correct reference to VBA split function? Regards, Ken Hutson San Antonio, TX
Here's one function I found in this NG. I just found it so I don't know whether or not it works. http://groups.google.com/groups?threadm= Mr. Oquendo has one, too, that was at his acadx.com web site, but it is down for a while, apparently. James
FYI, 2000 used vba 5.0 and 2ki and up use vb 6.0. Newer products have installed vba 6, which is why you have 2 vba dll's. They probably also updated the help, so that when you look at help, you see the file for version 6. Also, you can't change what version of vba acad uses, that is determined by the host app running vba. Sorry, looks like you're stuck with what you have. You should be able to code your own version of Split, though. To get substrings and put them in an array yourself, use InStr to determine the position of the delimiters and then use Mid to get the substring.
Here is a VB6-syntax-compatible version of the Split function written by Francesco Balena of vb2themax.com . (Sadly their main site seems to be exclusively .NET now but this link shows the original function at a different site). http://www.devx.com/vb2themax/Tip/19090 If you use this it means when you upgrade to a version of AutoCAD that uses VBA6 your code will continue to function. Regards Wayne Ivory IT Analyst Programmer Wespine Industries Pty Ltd