View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Flanagan Bob Flanagan is offline
external usenet poster
 
Posts: 340
Default Cannot suppress an ErrorMessage

Don, the error message means that you are referring to an object that does
not exist. For example, tying to to close a workbook that is already
closed, or getting a value from a sheet that has been deleted.

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"don bowyer" wrote in message
...
I have 2 separate applications, open at the same time.
When I select any one from "Window" in the Menu Bar I use
Private Sub Workbook_WindowActivate(ByVal Wn As Window)and
Private Sub Workbook_WindowDeactivate(ByVal Wn As
Window),located in "ThisWorkbook" , to set different
Custom ToolBars for each application.
That's OK. However when I close one of the applications
using Workbooks("XXXXXX.xls").Close in a separate module,
all is OK except for an Error Message "Application-defined
or Object defined Error" The "culprit" seems to be use of
the above Activate/DeActivate methods.
I have tried to suppress this message using OnError but
failed.
Any suggestions would be welcome.
Don