View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
don bowyer don bowyer is offline
external usenet poster
 
Posts: 9
Default Cannot suppress an ErrorMessage

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