"Excel CLOSE" ERROR

I

Intellihome

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!!!
 
K

K Dales

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

Intellihome

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
...
 
S

STEVE BELL

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top