Questions on adding modules, forms etc

Oct 24, 2013 at 4:05 AM
In my application I am building workbooks on the fly and may need to add vba modules, classes or form to a workbook. I have a few questions:
  1. I figured out how to add classes and modules. My users supply me a .bas,.cls or .frm files. I can then call package.Workbook.VbaProject.Modules.AddModule or package.Workbook.VbaProject.Modules.AddClass and set the code (I have to parse the file to skip the atrribute lines etc.). I want to be able to set the module's attributes - but I can't figure out how to add attributes to the module's attribute collection.
  2. I still cannot figure out how to add forms to the workbook.
Any help would be appreciated!