I have a template that is set to read only. In the rare occasion a user needs to edit it, I am including an 'override' button that changes the file access to read-write, saves the file, and then changes it back to read-only. The code is:
Sub save_over_click()
Dim answer
If ActiveWorkbook.ReadOnly = True Then
ActiveWorkbook.ChangeFileAccess Mode:=xlReadWrite
End If
answer = MsgBox("Saving over the template is permanent and can not be undone. Do you want to continue?", vbYesNo, "Save Over Template")
If answer = 6 Then
ActiveWorkbook.Save
End If
End Sub
My current problem is that excel warns me that the "FileX.xlt is already in use" when I try to execute the code. Any ideas?
Thanks,
Mark
This message was edited by mlopes1 on 2002-08-23 12:50
Sub save_over_click()
Dim answer
If ActiveWorkbook.ReadOnly = True Then
ActiveWorkbook.ChangeFileAccess Mode:=xlReadWrite
End If
answer = MsgBox("Saving over the template is permanent and can not be undone. Do you want to continue?", vbYesNo, "Save Over Template")
If answer = 6 Then
ActiveWorkbook.Save
End If
End Sub
My current problem is that excel warns me that the "FileX.xlt is already in use" when I try to execute the code. Any ideas?
Thanks,
Mark
This message was edited by mlopes1 on 2002-08-23 12:50