Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Question - is this possible?
I would like to show a userform, force certain textboxes
to be filled, then permit user to "Save". "Save" would: 1. preserve the values in those textboxes. 2. export the form (with code behind the form) and those textbox values, to a new workbook. 3. User would be able to name the new workbook and (single) sheet, and choose the Save Folder. 4. Edit some of the code behind the form in this new workbook to limit some of the options they had in the original form. 5. User would then navigate to the saved book, open it, and the saved form would be presented. Does this seem feasible, please? As regards 4.: the original form will be called via an addin, so perhaps the new form's code could be stored there, and then copied into the new workbook behind that form? If that makes sense. Help/examples most welcome please. Regards. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Question - is this possible?
"Stuart" wrote:
I would like to show a userform, force certain textboxes to be filled, then permit user to "Save". "Save" would: <snip All of that seems doable. You might do things in a slightly different order: 1. Export the form 2. Prompt for the name of the new Workbook, then create it. 3. Import the form into the new Workbook. 4. Copy the control settings from the old form to the new form. 5. Mess with the code in the new Workbook. You can export the form with something like this: Workbooks("Book1.xls").VBProject.VBComponents("Use rform1").Export ("temp.bas") and import it with Workbooks("Book2.xls").VBProject.VBComponents.Impo rt ("temp.bas") You can be more specific about the file path, etc. Export/Import preserves the layout & code of the form, but not its state. Looping through the controls collection to copy control states is a little tedious because each type of form has its own properties. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Question - is this possible?
Confirmation it seems "do-able" ..... Thanks.
A sample structure to get me started... Thanks again. Regards. "Shawn O'Donnell" wrote in message ... "Stuart" wrote: I would like to show a userform, force certain textboxes to be filled, then permit user to "Save". "Save" would: <snip All of that seems doable. You might do things in a slightly different order: 1. Export the form 2. Prompt for the name of the new Workbook, then create it. 3. Import the form into the new Workbook. 4. Copy the control settings from the old form to the new form. 5. Mess with the code in the new Workbook. You can export the form with something like this: Workbooks("Book1.xls").VBProject.VBComponents("Use rform1").Export ("temp.bas") and import it with Workbooks("Book2.xls").VBProject.VBComponents.Impo rt ("temp.bas") You can be more specific about the file path, etc. Export/Import preserves the layout & code of the form, but not its state. Looping through the controls collection to copy control states is a little tedious because each type of form has its own properties. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Question regarding UserForm | Excel Discussion (Misc queries) | |||
Userform Question | Excel Discussion (Misc queries) | |||
UserForm Question | Excel Programming | |||
UserForm Question | Excel Programming | |||
Userform question | Excel Programming |