Creating popup/prompt

lkjing

Board Regular
Joined
Jan 27, 2005
Messages
111
Hi does anyone know how to create popup/prompt when opening an excel file? Thanks!
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

lkjing

Board Regular
Joined
Jan 27, 2005
Messages
111
Thanks for the prompt reply! How do I go about doing it? Would you be able to list the steps?
 

tmischler

Well-known Member
Joined
Jun 17, 2004
Messages
669
open your worksbook

click alt + F11 to open the VB Window

In the top left (Project window), double click "this workbook"

from the resulting dropdown boxes, select "workbook" and "open"

paste in the code

save

close

open again...
 

lkjing

Board Regular
Joined
Jan 27, 2005
Messages
111

ADVERTISEMENT

Private Sub Workbook_Open(msgbox "Hello")

End Sub

is this the correct way to do it? I tried it but it did not work..
 

pcc

Well-known Member
Joined
Jan 21, 2003
Messages
1,345

ADVERTISEMENT

Code:
Private Sub Workbook_Open()
MsgBox "Hello"
End Sub
 

lkjing

Board Regular
Joined
Jan 27, 2005
Messages
111
Thanks...I did a successful run within the editor but the popup doesnt appear when I opened the file?
 

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
When you are in the visual editor, you have to put the code in "This Workbook"

texasalynn
 

Watch MrExcel Video

Forum statistics

Threads
1,122,499
Messages
5,596,517
Members
414,074
Latest member
Matthew Kakde

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
Top