message box when file is opened

O

oxicottin

Hello I have been serching around in this forum and dont really understand
how to do this. I want a pop up message to open when an .xls file is opened.
I did find someone wrote this. But I dont know how to do this I never messed
with macro ect. Can someone explaing in depthe how this is done? Thanks!!!!!

putn the following code in yopur workbook module ('ThisWorkbook'):
sub workbook_open()
msgbox "Now opening..."
end sub
 
R

Ron de Bruin

Hi oxicottin

Alt F11 to open the editor
To be sure you see all windows press one time Ctrl-R and F7

Double click on the ThisWorkbook module on the left in the project window
If you not see it click on the + before the project/file name

Then paste this in the code window

Private Sub Workbook_Open()
MsgBox "Hi"
End Sub

Then use Alt q to close the editor
Save/close and reopen the file now
 
Top