View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default 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".