I hope someone is familiar with the VBA Extensibility reference. That's the thing that lets you write code that modifies forms, modules, and projects at design time. It's very useful and notoriously badly documented.
I have some procedures that literally work one day and don't work the next. I can't figure out why. As an example:
For each aVbc in MyDoc.VBProject.VBcomponents
If left(aVbc.name, 8) = "UserForm", then
ActiveDocument.VBProject.VBComponents.Remove(aVbc) ' <=== FAIL Object does not support this property or method.
' I also tried this instead:
aVbc.Remove ' <=== FAIL: Object does not support this property or method.
end if
next aVbc
It used to work, honest. What could I have done that changed it?
Page 1 of 1
VBA Extensibility Problem Sometimes it just doesn't work
Share this topic:
Page 1 of 1

Help


Back to top








