Hi
I'm using this KBase entry http://vbaexpress.com/kb/getarticle.php?kb_id=578 (thanks John) in a workbook.
I would like to have the sheet ("Prompt") protected, but as you see there has to be an entry in A100,
[vba]Private Sub HideSheets()
'
Dim Sheet As Object '< Includes worksheets and chartsheets
'
With Sheets("Prompt")
'
'the hiding of the sheets constitutes a change that generates
'an automatic "Save?" prompt, so IF the book has already
'been saved prior to this point, the next line and the lines
'relating to .[A100] below bypass the "Save?" dialog...
If ThisWorkbook.Saved = True Then .[A100] = "Saved"
'
.Visible = xlSheetVisible
'
For Each Sheet In Sheets
If Not Sheet.Name = "Prompt" Then
Sheet.Visible = xlSheetVeryHidden
End If
Next
'
If .[A100] = "Saved" Then
.[A100].ClearContents
ThisWorkbook.Save
End If
'
Set Sheet = Nothing
End With
'
End Sub[/vba]
When i protect the sheet and put Unprotect and Protect in the code, the "Save?" dialog keeps popping up.
How and where do I have to put in "Unprotect" and at which point the "Protect" statement to prevent the Save-dialog?
Gert Jan