Pop-up when opening a file

Pollie

New Member
Joined
Sep 11, 2006
Messages
4
I would like to create a popup which asks for the username immediately when this user opens the file. The username I want to store somewhere in the file. Does anybody know if this is possible and how to do this?
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Welcome to the board.

Why not just use Application.username in VBA to get the username without having to ask for it?
 
Upvote 0
That's an option for the username, but actually I want more pop-ups with other info than username.
 
Upvote 0
Why not create a userform that you can show when the workbook opens like this?
Code:
Private Sub Workbook_Open()
    UserForm1.Show
End Sub
 
Upvote 0
If it were just one item, you could use something like this in the ThisWorkbook module:

Code:
Private Sub Workbook_Open()
[z1] = Application.InputBox("If your user name is not " & Application.UserName & " please enter the correct username")
If [z1] = "" Then [z1] = Application.UserName
End Sub

To prompt the user to enter a Username

If you're going to be asking for more information that just that, it is better to use a userform than a barrage of Inputboxes.
 
Upvote 0
Hi, Pollie
Welcome to the Board !!!!!

perhaps you mean something like this
Code:
Private Sub Workbook_Open()
Dim user_name As String
Dim FBR As Long             'First Blank Row

'instead of the default "", you can use Application.UserName)

user_name = Application.InputBox("name please", "title", "")
    With Sheets("login")
    FBR = .Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    .Cells(FBR, 2) = user_name
    .Cells(FBR, 1) = Now
    End With

End Sub
kind regards,
Erik

EDIT: didn't see any reply before posting
 
Upvote 0

Forum statistics

Threads
1,226,504
Messages
6,191,428
Members
453,657
Latest member
DukeJester

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