Hi,
I am using Excel 2003 on XP. I have various processes that open workbooks, do some operations on them and then close them again. This normally works fine, but I occasionally get a problem with the code in that it throws a debug error when it gets to the close stage. The simple code is:
When run the debug error highlights the close line. If I then continue the processing through F8 (step into) or F5 (Run) it continues fine - I do not change anything. This indicates that the code and the file itself are OK, but gives no reason for the halt in processing.
I have even re-installed Excel in an attempt to fix but I still get the problem.
Appreciate if anyone can point me to the cause.
Thanks
I am using Excel 2003 on XP. I have various processes that open workbooks, do some operations on them and then close them again. This normally works fine, but I occasionally get a problem with the code in that it throws a debug error when it gets to the close stage. The simple code is:
Code:
Sub DemonstrateCloseError()
Workbooks.Open "C:\boomer\Open and Close.xls"
' do stuff
Workbooks("Open and Close.xls").Close savechanges:=True
End Sub
I have even re-installed Excel in an attempt to fix but I still get the problem.
Appreciate if anyone can point me to the cause.
Thanks