msgbox on workbook open

T

Thrava

Hi group,

What would be the vb code to have a message box with a
vbonly button to pop up when the workbook is first opened?

Thanks
Thrava
 
F

Frank Kabel

Hi Thrava
put the following code in your workbook module

Private Sub Workbook_Open()
Dim ret
ret = MsgBox("hallo", vbOKOnly)
End Sub
 
T

Thrava

Thank you very much for this Frank
Thrava

-----Original Message-----
Hi Thrava
put the following code in your workbook module

Private Sub Workbook_Open()
Dim ret
ret = MsgBox("hallo", vbOKOnly)
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

.
 
T

Thava

Hi Again Frank,
I've posted it in a module, but I don't see any
messagebox? appearing upon lunch !
 
F

Frank Kabel

Hi
you have to put this in the workbook module. To get there try the
following
- open the VBA editor
- double-click on 'Thisworkbook' in the left explorer window for your
project
- paste the code in this module
 
F

Frank Kabel

Hi
this is a workbook event procedure. This has to be stored in the
workbook module. Quite similar worksheet event procedures (e.g.
worksheet_change) have to be placed in the respective worksheet
modules.
You may have a look at
http://www.cpearson.com/excel/events.htm
for more information
 
T

Thrava

Thank you Frank
Thrava
-----Original Message-----
Hi
this is a workbook event procedure. This has to be stored in the
workbook module. Quite similar worksheet event procedures (e.g.
worksheet_change) have to be placed in the respective worksheet
modules.
You may have a look at
http://www.cpearson.com/excel/events.htm
for more information

--
Regards
Frank Kabel
Frankfurt, Germany
window for
your

.
 

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