Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Input Box Promt Aziz Ahmedabadwala[_2_] Excel Programming 5 June 5th 06 06:36 PM
Promt when closing Excel Carit Excel Discussion (Misc queries) 0 March 22nd 06 07:55 AM
ms query promt in vba tina Excel Programming 0 March 21st 06 03:40 PM
Can we Set Default value for the Excel promt(Y/N) SpiderSwamy Excel Programming 2 March 16th 06 05:32 PM
Printing to Adobe without getting promt for name Danny McCarthy Excel Programming 1 October 29th 03 02:26 PM


All times are GMT +1. The time now is 08:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"