Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pop up message box?
Is there a way to create a pop up message in Excel upon opening a workbook?
I want to create something along the lines of "resave this file as xxxx". -- Gracie |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pop up message box?
Hi,
Alt+F11 to open vb editor. Double click 'this workbook' and paste this in on the right. The messagebox dies after 4 seconds if a button isn't pressed. Private Sub Workbook_Open() Dim MyBox As Object Dim Duration As Long Duration = 4 'Seconds Msg = "Save workbook as ******" Ttl = " Your Title" Set MyBox = CreateObject("WScript.Shell") response = MyBox.PoPup(Msg, Duration, Ttl, vbOKCancel) End Sub Mike "Graciegirl" wrote: Is there a way to create a pop up message in Excel upon opening a workbook? I want to create something along the lines of "resave this file as xxxx". -- Gracie |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Pop up message box?
Easily done but you might prefer to take the user out of the process and
save the workbook as your new name when you close it? For the pop-up upon opening................... Private Sub Workbook_Open() MsgBox "This file must be re-saved as XXXX" End Sub To saveas XXXX.xls when closing................... Private Sub Workbook_BeforeClose(Cancel As Boolean) 'Note that any existing "XXXX" workbook is overwritten If ActiveWorkbook.Name = "XXXX.xls" Then Exit Sub Application.DisplayAlerts = False ActiveWorkbook.SaveCopyAs Filename:="XXXX.xls" ActiveWorkbook.Save 'saves original workbook also Application.DisplayAlerts = True End Sub Both of these go into Thisworkbook module. Right-click on the Excel Icon left of "file" on the worksheet menu bar and select "View Code" Paste whichever event you want into that module. Gord Dibben MS Excel MVP On Tue, 23 Sep 2008 13:33:01 -0700, Graciegirl wrote: Is there a way to create a pop up message in Excel upon opening a workbook? I want to create something along the lines of "resave this file as xxxx". |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pop up message | Excel Discussion (Misc queries) | |||
If then Message Box | Excel Discussion (Misc queries) | |||
How do I get rid of the #/DIV/0! message | Excel Worksheet Functions | |||
Pop up message | Excel Discussion (Misc queries) | |||
changing the message in an error message | Excel Worksheet Functions |