Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "Excel CLOSE" ERROR


Hello everyone,

I am experiencing a very strange Excel behaviour.

I have an Excel workbook, which has several elements with events. Lik
ComboBox_Change().

So, when I close just a workbook, none of the events handlin
procedures are called and I do not have any problems.

When I want to close Excel, then for some reason it starts processin
those events, and because of the FOCUS problem for SHEETS.RANGE metho
I get error: SHEETS method of _Global failed.

Is there any way for Excel not to start events' handling procedures a
closing?
Please help, I don't see where the problem!!!

--
Intellihom
-----------------------------------------------------------------------
Intellihome's Profile: http://www.msusenet.com/member.php?userid=147
View this thread: http://www.msusenet.com/t-187053255

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default "Excel CLOSE" ERROR

Have you tried setting Application.EnableEvents to False? Perhaps in the
Workbook_BeforeClose Event?

"Intellihome" wrote:


Hello everyone,

I am experiencing a very strange Excel behaviour.

I have an Excel workbook, which has several elements with events. Like
ComboBox_Change().

So, when I close just a workbook, none of the events handling
procedures are called and I do not have any problems.

When I want to close Excel, then for some reason it starts processing
those events, and because of the FOCUS problem for SHEETS.RANGE method
I get error: SHEETS method of _Global failed.

Is there any way for Excel not to start events' handling procedures at
closing?
Please help, I don't see where the problem!!!!


--
Intellihome
------------------------------------------------------------------------
Intellihome's Profile: http://www.msusenet.com/member.php?userid=1479
View this thread: http://www.msusenet.com/t-1870532557


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default "Excel CLOSE" ERROR

It would help if you post the code.

--
HTH

Bob Phillips

"Intellihome" wrote in message
...

Hello everyone,

I am experiencing a very strange Excel behaviour.

I have an Excel workbook, which has several elements with events. Like
ComboBox_Change().

So, when I close just a workbook, none of the events handling
procedures are called and I do not have any problems.

When I want to close Excel, then for some reason it starts processing
those events, and because of the FOCUS problem for SHEETS.RANGE method
I get error: SHEETS method of _Global failed.

Is there any way for Excel not to start events' handling procedures at
closing?
Please help, I don't see where the problem!!!!


--
Intellihome
------------------------------------------------------------------------
Intellihome's Profile: http://www.msusenet.com/member.php?userid=1479
View this thread: http://www.msusenet.com/t-1870532557



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "Excel CLOSE" ERROR


Not a problem here is my code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("About").Select

Application.EnableEvents = False

End Sub

and the other one:

Private Sub ComboBox1_Change()

If Sheets("Display").Range("B39").Value = vbNullString Then <<<<<<
this is where it gives me an error, but only when I try to close whol
Excel, not just a workbook.
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.ActiveSheet.Range("A1").Select
...

--
Intellihom
-----------------------------------------------------------------------
Intellihome's Profile: http://www.msusenet.com/member.php?userid=147
View this thread: http://www.msusenet.com/t-187053255

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default "Excel CLOSE" ERROR

In excel 2000 these work for me

If Sheets("Display").Range("B39").Value = vbNullString Then

If Sheets("Display").Range("B39") = vbNullString Then

If len(Sheets("Display").Range("B39")) = 0 Then
--
steveB

Remove "AYN" from email to respond
"Intellihome" wrote in message
...

Not a problem here is my code:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("About").Select

Application.EnableEvents = False

End Sub

and the other one:

Private Sub ComboBox1_Change()

If Sheets("Display").Range("B39").Value = vbNullString Then <<<<<<<
this is where it gives me an error, but only when I try to close whole
Excel, not just a workbook.
Application.ScreenUpdating = False
Application.EnableEvents = False
Application.ActiveSheet.Range("A1").Select
...


--
Intellihome
------------------------------------------------------------------------
Intellihome's Profile: http://www.msusenet.com/member.php?userid=1479
View this thread: http://www.msusenet.com/t-1870532557



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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Excel crashes on "Close" Visual Basic error 400 [email protected] Excel Discussion (Misc queries) 3 March 19th 08 03:45 PM
Close workbook with "Cancel=TRUE" in the BeforeClose()" Wellie[_3_] Excel Programming 1 October 16th 04 09:46 PM
Getting "compile error" "method or data member not found" on reinstall Bp Excel Programming 1 April 23rd 04 04:42 PM
How can I get "File Close" to prompt me to "Save Changes" ?? Charles Jordan Excel Programming 4 July 31st 03 04:01 PM


All times are GMT +1. The time now is 08:16 AM.

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"