This code works. I can't tell why from one statement what your problem is.
Maybe you forgot to use SET when you declared wkbk
Sub test()
Workbooks.Open Filename:= _
ActiveWorkbook.Path & "\" & "tempfile.xls"
Set wkbk = ActiveWorkbook
wkbk.Close
End Sub
The wkbk is a correct object, I can see it is properly formed in the
local window. I have a nasty work around which involves trying to
close, if that fails then disabling events and closing again. I would
still be interested as to why the .close method can fail when you
overload some of the event methods
Tom
> This code works. I can't tell why from one statement what your problem is.
> Maybe you forgot to use SET when you declared wkbk
[quoted text clipped - 29 lines]
> > Thanks
> > Tom
Joel - 24 Sep 2007 16:10 GMT
Try adding in a delay in the Deactivate method. I haven't used Deactivate
method myself in any code I wrote.
> The wkbk is a correct object, I can see it is properly formed in the
> local window. I have a nasty work around which involves trying to
[quoted text clipped - 37 lines]
> > > Thanks
> > > Tom