Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cannot suppress an ErrorMessage

I think you have to look at your code and see if you try to do something to
a commandbar or something that has already been deleted.

--
Regards,
Tom Ogilvy

"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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suppress @VALUE! on a template. Sol Excel Discussion (Misc queries) 4 December 2nd 08 10:48 PM
Suppress a row DCN Excel Worksheet Functions 2 January 22nd 07 07:16 PM
suppress warnings Claude Excel Programming 2 April 21st 04 12:57 PM
Errormessage when button is pressed twice or more Pointerman Excel Programming 4 April 7th 04 03:56 PM
How to suppress Time ? Milind Excel Programming 2 September 14th 03 01:36 AM


All times are GMT +1. The time now is 09:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"