Userform triggered on opening of Excel

cs1ctp

Board Regular
Joined
Oct 7, 2005
Messages
122
Hi,

Was just wondering if it is possible to do the following:

Open up an Excel document stored on my computer and on opening, a userform is triggered requesting a user to log on. I understand there is a way of protecting the workbook, but I wish to customise the logon screen and fire different events depending on the user credentials.

I literally want the first thing the user sees when they open the Excel Document to be a UserForm ... Is this possible??

Many thanks in advance for your help,

Chris
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Chris

It certainly is possible.

Assuming the userform exists just put something like this in the workbook's open event.
Code:
Userform1.Show

To access the Open event of a workbook:

1. Right click the small Excel icon next to File on the main toolbar and select View Code.

2. Select Workbook from the left dropdown.

3. You should now see the following code:

Code:
Private Sub Workbook_Open()

End Sub
This is where you put any code to be run when the workbook opens.

You would need code/controls in/on the userform for the rest.
 
Upvote 0

Forum statistics

Threads
1,207,111
Messages
6,076,607
Members
446,216
Latest member
BEEALTAIR

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top