G
Guest
I am opening a Word document with code like this:
Dim WordApp As New Word.Application
Try
WordApp.Documents.Open(CType("C:\Temp\mydoc.doc", Object))
etc. -- etc. -- etc.
Return True
Catch ex As Exception
Return False
Finally
Try
WordApp.Documents.Close()
WordApp.Quit()
Catch ex As Exception
End Try
End Try
This code works fine unless I crash somewhere in the etc part of the code
and the Finally never triggers properly. In this case, the file becomes
locked in a read-only mode. I can't delete it, edit it, or rename it
regardless of what I try short of rebooting. The only way I can get it
released is to reboot. Is there something that can be done to get it
unlocked without rebooting?
Dim WordApp As New Word.Application
Try
WordApp.Documents.Open(CType("C:\Temp\mydoc.doc", Object))
etc. -- etc. -- etc.
Return True
Catch ex As Exception
Return False
Finally
Try
WordApp.Documents.Close()
WordApp.Quit()
Catch ex As Exception
End Try
End Try
This code works fine unless I crash somewhere in the etc part of the code
and the Finally never triggers properly. In this case, the file becomes
locked in a read-only mode. I can't delete it, edit it, or rename it
regardless of what I try short of rebooting. The only way I can get it
released is to reboot. Is there something that can be done to get it
unlocked without rebooting?