View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Removing & Importing user forms via code?

Try something like the following:

With ActiveWorkbook.VBProject.VBComponents
.Remove .Item("UserForm1")
.Import Filename:="C:\whatever\userform1.frm"
End With

See www.cpearson.com/excel/vbe.htm for more details.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"R-Enemy" wrote in message
...

Can I programmatically remove a user form and then import a
user from?

The reason is I have a many workbooks that all use the same
form and I
updated the code in one of the workbooks and I want to update
all the
others without having to manually open each one, then open VBA,
then
hit remove and then import. This would take way too long.

Thanks for any help.


--
R-Enemy
------------------------------------------------------------------------
R-Enemy's Profile:
http://www.excelforum.com/member.php...o&userid=16732
View this thread:
http://www.excelforum.com/showthread...hreadid=319362