Private Sub Workbook_Open()
Dim LinkSource As Variant
Dim Result As Long
Dim FocusSheet As Worksheet
Const Password = "Rainbow"
If Not IsDate(Sheets("Closing").[B4]) Then
'Result = MsgBox("Do you want to update external links?", vbYesNo + vbQuestion)
'If Result = vbYes Then
For Each FocusSheet In Sheets
FocusSheet.Unprotect Password
Next FocusSheet
For Each LinkSource In ThisWorkbook.LinkSources
ThisWorkbook.UpdateLink Name:=LinkSource, Type:=xlExcelLinks
Next LinkSource
For Each FocusSheet In Sheets
FocusSheet.Protect Password:=Password, AllowFormattingColumns:=True, AllowFormattingRows:=True
Next FocusSheet
'End If
End If
Application.OnKey "{TAB}"
Application.OnKey "+{TAB}"
End Sub
|