See User Form On Open

W

wx4usa

I have built a user form per Debras instructions @ contextures. It
works fine, but when I close and save and later re-open, how do I see
my form? Is there a way to make it automatically re-appear on
opening? Or did I lose it?
 
W

wx4usa

I have built a user form per Debras instructions @ contextures. It
works fine, but when I close and save and later re-open, how do I see
my form?  Is there a way to make it automatically re-appear on
opening? Or did I lose it?

By the way, I used a button with the following code. and it says
error 424 object required??

Sub Rectangle1_Click()
frmSalesEntry.Show
End Sub
 
D

Dave Peterson

You could use a macro.

This goes in a General module--not behind a worksheet and not behind
ThisWorkbook.

Option Explicit
Sub Auto_Open()
userform1.show
End Sub

Change userform1 to the real name of your userform.
 
W

wx4usa

You could use a macro.

This goes in a General module--not behind a worksheet and not behind
ThisWorkbook.

Option Explicit
Sub Auto_Open()
   userform1.show
End Sub

Change userform1 to the real name of your userform.

Thanks Dave and Sheeloo !!
 
W

wx4usa

Thanks Dave and Sheeloo !!

Hi Dave,

I cannot get the form to open automatically when the workbook is
opened. It will work when I hit run sub with the VB editor window. Did
I put it in the wrong place?
 
W

wx4usa

I don't know.

Where did you put it?

Did you call it Auto_Open?

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

wx4usawrote:

<<snipped>>

Hi Dave

Thanks so much for your help.

I pasted the following...

Option Explicit
Sub Auto_Open()
SalesEntry.Show
End Sub

Under the This workbook tab. The top of the window says general and
auto_open

SalesEntry is the user form name.

I can manually run the macro, but not automatically.

It will not auto open when the workbook is opened. I have to click
enable content. Is there a security issue? Should it auto open after I
click enable content?
 
W

wx4usa

I don't know.

Where did you put it?

Did you call it Auto_Open?

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

wx4usawrote:

<<snipped>>

Hi Dave

Thanks so much for your help.

I pasted the following...

Option Explicit
Sub Auto_Open()
SalesEntry.Show
End Sub

Under the This workbook tab. The top of the window says general and
auto_open

SalesEntry is the user form name.

I can manually run the macro, but not automatically.

It will not auto open when the workbook is opened. I have to click
enable content. Is there a security issue? Should it auto open after I
click enable content?
 
D

Dave Peterson

You have two choices.

Move the code to a general module (insert|Module).

Or rename the procedure (and leave it under the ThisWorkbook module).
Option Explicit
Sub Workbook_Open()
SalesEntry.Show
End Sub
 
W

wx4usa

I don't know.

Where did you put it?

Did you call it Auto_Open?

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

wx4usawrote:

<<snipped>>

Hi Dave

Thanks so much for your help.

I pasted the following...

Option Explicit
Sub Auto_Open()
SalesEntry.Show
End Sub

Under the This workbook tab. The top of the window says general and
auto_open

SalesEntry is the user form name.

I can manually run the macro, but not automatically.

It will not auto open when the workbook is opened. I have to click
enable content. Is there a security issue? Should it auto open after I
click enable content?
 
W

wx4usa

You have two choices.

Move the code to a general module (insert|Module).

Or rename the procedure (and leave it under the ThisWorkbook module).
Option Explicit
Sub Workbook_Open()
  SalesEntry.Show
End Sub



wx4usawrote:

I am not sure what a general module is. What does that mean Dave?
 
D

Dave Peterson

Inside the VBE:
Insert|Module
will give you that general module

ps.

Those links to instructions that I posted in a previous message may be worth
reviewing.
 
W

wx4usa

Inside the VBE:
Insert|Module
will give you that general module

ps.

Those links to instructions that I posted in a previous message may be worth
reviewing.



wx4usawrote:

Thanks for your patience and help Dave!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top