View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Cell change event causing EXCEL to crash

I'd try changing printers (or printer drivers).

Lots of crashes in excel turn out to be caused by printer drivers.

And since you're playing with a color (something displayed on the screen), excel
uses the printer driver to determine how it should look on the screen and when
printed (WYSIWYG stuff).



Ashish wrote:

Hi,

I am writing the following piece of code to change a cell color when its
content is changed:

************************************************** *****
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("$E$25")) Is Nothing Then
If ThisWorkbook.Worksheets(6).Cells(25, 5) 0 Then
ThisWorkbook.Worksheets(6).Cells(25, 5).Interior.Pattern = xlGray16
End If
End Sub
************************************************** *****

However, my excel window crashes and i get the following message "Microsoft
Excel has encoutered a problem and needs to close..."
Can anyone tell me why this should happen?

Appreciate an urgent response.

Thanks and regards,
Ashish


--

Dave Peterson