View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Pop up warning message!

Use the workbook_open event

See Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm

Private Sub Workbook_Open()
if year(date) < 2005 and month(date) < 6 then
msgbox "This workbook is only for Jun 2006"
if Application.Username < "canix" then
thisworkbook.close Savechanges:=False
end if
end if
End Sub

--
Regards,
Tom Ogilvy


"canix" wrote in
message ...

I have a monthly workbook log and a sheet for each week. I want to put
a warning pop up message when user open the workbook not designed for
the month compare to the current system date. For example, user want
open a sept workbook log and today is only august, so it will popup a
warning message to tell user that they need to open the workbook for
august instead. And possiblly a popup message for each weekly
worksheet as well.


--
canix
------------------------------------------------------------------------
canix's Profile:

http://www.excelforum.com/member.php...o&userid=25962
View this thread: http://www.excelforum.com/showthread...hreadid=393383