Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Promt When Closing
This may be an easy one but I am very new to Macros.
I would like a promt/Window/box, whatever tou call it to come on screen when closing the spreadsheet reminding me to ensure that the worksheet is protected. Is this possible? If I can go onestep further I would like it to appear when only certain people cloes the spreadsheet. regards |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Promt When Closing
You would use the beforeclose event.
http://www.cpearson.com/excel/events.htm for an overview of events. Environ("Username") tells you the login id demo'd from the immediate window: ? environ("Username") OgilvyTW -- Regards, Tom Ogilvy "TheRook" wrote: This may be an easy one but I am very new to Macros. I would like a promt/Window/box, whatever tou call it to come on screen when closing the spreadsheet reminding me to ensure that the worksheet is protected. Is this possible? If I can go onestep further I would like it to appear when only certain people cloes the spreadsheet. regards |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Promt When Closing
here is an example
Dim wSheet As Worksheet 'MsgBox Environ("Username") Select Case Environ("Username") Case "Name1" ' user name of exempt from protect Case "name2" 'user name of exempt from protect Case Else MsgBox "n" Select Case MsgBox("Do you want to Protect all Sheets before Closing?", vbYesNo) Case vbYes For Each wSheet In Worksheets wSheet.Protect ' this is protect without password Next wSheet Case vbNo End Select End Select End Sub TheRook wrote: This may be an easy one but I am very new to Macros. I would like a promt/Window/box, whatever tou call it to come on screen when closing the spreadsheet reminding me to ensure that the worksheet is protected. Is this possible? If I can go onestep further I would like it to appear when only certain people cloes the spreadsheet. regards |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Input Box Promt | Excel Programming | |||
Promt when closing Excel | Excel Discussion (Misc queries) | |||
ms query promt in vba | Excel Programming | |||
Can we Set Default value for the Excel promt(Y/N) | Excel Programming | |||
Printing to Adobe without getting promt for name | Excel Programming |