Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Further to my earlier message, this class can be added to give a
reliable 'read-only' tag in the title bar when using the full path in title bar code. [Class ToggleReadOnlyEvents] Option Explicit Private WithEvents togReadOnlyButton As Office.CommandBarButton Private Sub Class_Initialize() ' Not sure if this ID is stable. Could use the name instead. Set togReadOnlyButton = CommandBars.FindControl(ID:=456) End Sub Private Sub Class_Terminate() Set togReadOnlyButton = Nothing End Sub Private Sub togReadOnlyButton_Click( _ ByVal Ctrl As Office.CommandBarButton, _ CancelDefault As Boolean) Dim Wb As Workbook Set Wb = ActiveWorkbook If Wb.ReadOnly = True Then If GetAttr(Wb.FullName) And vbReadOnly Then MsgBox "'" & Wb.Name & "' is read-only." _ & " To save a copy, click OK, then give the" _ & " workbook a new name in the Save As dialog box.", _ vbExclamation, "Microsoft Excel" Else Wb.ChangeFileAccess xlReadWrite End If Else Wb.ChangeFileAccess xlReadOnly End If showFullName Wb CancelDefault = True End Sub Private Sub showFullName(Wb As Workbook) Dim caption As String On Error Resume Next caption = Wb.FullName If Wb.ReadOnly Then caption = caption & " [Read-Only]" End If Wb.Windows(1).caption = caption End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Full path in title bar | Excel Discussion (Misc queries) | |||
Can the full path be shown in the Title Bar? | Excel Discussion (Misc queries) | |||
Show full path title in title bar? | New Users to Excel | |||
full UNC path in footer | Excel Discussion (Misc queries) | |||
How to change the Excel Title Bar to show the full file path na... | Excel Discussion (Misc queries) |