ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   "Excel CLOSE" ERROR (https://www.excelbanter.com/excel-programming/331600-excel-close-error.html)

Intellihome[_20_]

"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


K Dales[_2_]

"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



Bob Phillips[_7_]

"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




Intellihome[_23_]

"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


STEVE BELL

"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





All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com