Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question regarding UserForm TotallyConfused Excel Discussion (Misc queries) 0 September 3rd 09 09:38 PM
Userform Question Greg B Excel Discussion (Misc queries) 3 March 10th 05 10:46 AM
UserForm Question jer Excel Programming 4 January 13th 05 11:19 PM
UserForm Question bforster1[_25_] Excel Programming 1 November 6th 04 01:21 PM
Userform question David Goodall Excel Programming 5 May 12th 04 10:18 AM


All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"