All;
I have a section of VBA code that worked a while ago, but doesn't any longer. The code hasn't changed. The code is designed to update the Table of Contents within the document. The code works when the document is unlocked but doesn't when it is locked. The rest of the document which utilizes code has not been effected at all. What could be causing the issue and what might the solution be?
Security in place:
VBA Password
Document Password
When the Document password is unlocked the code works
When the VBA password is set it does not effect if the code works or doesn't
Thanks,
Mike
I have a section of VBA code that worked a while ago, but doesn't any longer. The code hasn't changed. The code is designed to update the Table of Contents within the document. The code works when the document is unlocked but doesn't when it is locked. The rest of the document which utilizes code has not been effected at all. What could be causing the issue and what might the solution be?
Security in place:
VBA Password
Document Password
When the Document password is unlocked the code works
When the VBA password is set it does not effect if the code works or doesn't
Code:
Sub Document_Open()
'Application.ScreenUpdating = False
If ISPM15_Box.Value = True Or FCA_Overseas.Value = True Then
ActiveDocument.Bookmarks("AppendixD").Range.Font.Hidden = False
Else
ActiveDocument.Bookmarks("AppendixD").Range.Font.Hidden = True
End If
Call TofC_Update
'Application.ScreenUpdating = True
End Sub
'________________________________________________________
Private Sub TofC_Update()
' Updates table of contents
ActiveDocument.TablesOfContents(1).Update
Application.ScreenUpdating = True
End Sub
Thanks,
Mike