![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Location: Houston, Texas
Posts: 28
|
I've got an Excel workbook that I've saved with the password required to modify file sharing option (under Save As / Options).
For some reason I haven't been able to figure out yet, simply opening the workbook read only & immediately closing it without making any changes sets the dirty bit & the user is prompted to save changes on close. Until I can figure out what's setting the dirty bit, I'd like to test the Saved property in a Workbook_Close routine and allow the user to close without saving, but only if the workbook was opened read only. Is this possible? If so, what property can I test to see if the workbook was opened read-only? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
Quite easy this:-
Code:
Sub Test()
If ThisWorkbook.ReadOnly = True Then
MsgBox "This is Readonly"
Else
MsgBox "This is a read/write workbook"
End If
End Sub
D |
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Location: Houston, Texas
Posts: 28
|
Thanks d, works brilliantly.
I knew it had to be easy. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|