ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   create a message box when opening a file in word or excel 2007 (https://www.excelbanter.com/excel-discussion-misc-queries/260687-create-message-box-when-opening-file-word-excel-2007-a.html)

David

create a message box when opening a file in word or excel 2007
 
How can i create a message box to appear in my files in MS word or excel
2007, for example "Good Morning" when my colleagues open a file

Jacob Skaria

create a message box when opening a file in word or excel 2007
 
Use the Workbook Open event to display a message for a specific excel
workbook;

Set the security level to low/medium in (Tools|Macro|Security). From
workbook press Alt+F11 to launch VBE (Visual Basic Editor). From the left
treeview search for the workbook name and click on + to expand it. Within
that you should see the following

VBAProject(Your_Filename)
Microsoft Excel Objects
Sheet1(Sheet1)
Sheet2(Sheet2)
Sheet3(Sheet3)
This Workbook

Double click 'This WorkBook' and paste the below code to the right code pane.

Private Sub Workbook_Open()
MsgBox "Message to be displayed"
End Sub

--
Jacob


"David" wrote:

How can i create a message box to appear in my files in MS word or excel
2007, for example "Good Morning" when my colleagues open a file



All times are GMT +1. The time now is 04:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com