I have also tried to use VBA to read and write DataGroup data using VBA but alas have never succeeded. In my case I wanted to read data such as fire rating and acoustic information from a wall and then modify a text field as a result of it.
I did try to take the issue up with Bentley and got the following response:
"If the problem you’re trying to solve is what’s described there below, I do hope you have SS6. I’m not sure if we have anything that would accomplish this pre-ss6.
With that said, to modify datagroup instance data on an element, you should be using TFCatalogItem. Here’s a code snippet for c#, should be very similar in VBA.
TFCatalogItemList catalogItemNode = new TFCatalogItemList();
catalogItemNode.asTFCatalogItem.InitFromElementDescr (elDescr, “”);
TFPropertyList propertyList = catalogItemNode.AsTFCatalogItem.GetPropertyList(“”);
//property list here will contain all datagroup properties of the element, you can iterate it and change values etc. it will have it’s ID set as Name and translated ID as DisplayName (e.g. @Wall_Common/Height = Wall Height)
//after you finish changing/inspecting any values, you may want to write them back to the catalogitem and then to the element.
catalogItemNode.asTFCatalogItem.setPropertyList(propertyList, “”);
catalogItemNode.asTFCatalogItem.AttachLinkagesOnElement(ref elDescr, “”);
It’s all completely fresh out of my head, so I’m sorry for any errors there may be. If there’s something else you need help with, I suggest posting in Bentley Communities. Chances are you may get an answer faster."
Unfortunately I have not had the time to test any of this out..... Things like work get in the way..
/James