Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

VBA Extensibility Problem


  • Please log in to reply
No replies to this topic

#1 shawnvw

shawnvw

  • Members
  • 124 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:12:45 PM

Posted 18 January 2010 - 08:42 PM

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?

BC AdBot (Login to Remove)

 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users