Try this: Sub ExportForms() Dim vbaModule Dim VBComp, tmp, Fldr Set vbaModule = ThisWorkbook.VBProject.VBComponents Fldr = "C:\temp\forms\" Application.StatusBar = "Exporting all Forms..." Application.EnableEvents = False For Each VBComp In vbaModule Select Case VBComp.Type Case 1 'Modules Debug.Print "Module: " & VBComp.Name Case 3 'Forms ThisWorkbook.VBProject.VBComponents(VBComp.Name).Export (Fldr & VBComp.Name & ".bas") Case 100 'Sheets Debug.Print "Sheet: " & VBComp.Name End Select Next VBComp Application.EnableEvents = True Application.StatusBar = False End Sub
I think you'll need the References: Microsoft Visual Basic for Applications Extensibility 5.3? or one of the Object Libraries. I also have: Visual Basic for Applications Microsoft Excel 12.0 Object Library OLE automation Microsoft Office 12.0 Object Library Microsoft Forms 2.0 Object Library It's got to be one of them!!1 Paul ________________________________ From: Mike Holder <mike.holder.b...@statefarm.com> To: excel-macros@googlegroups.com Sent: Fri, December 11, 2009 5:16:35 AM Subject: $$Excel-Macros$$ Copy all userforms to another workbook I am currently working on an Excel project that I need to be able to update certain worksheets and userforms. I have built the code to replace the worksheets and have code to export / import an individual userform to the other workbook. I am having problems finding a way to loop through each of the userforms in the FORM module to be able to export/import each individual userform. Does anyone have any code or know of a way to do this? Thanks in advance! Mike-- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,500 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,500 subscribers worldwide and receive many nice notes about the learning and support from the group. Our goal is to have 10,000 subscribers by the end of 2009. Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe