Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Cell change event causing EXCEL to crash

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

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Cell change event causing EXCEL to crash

Hi,

Your sub is missing an End If but that wouldn't cause Excel to crash. I
would try restarting your PC.

Mike

"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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Cell change event causing EXCEL to crash

Hi,

The sub is as follows:

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

Please let me know why should EXCEL crash when i invoke this SUBROUTINE
(MACRO). BTW, restarting the PC does not seem to help.

Thanks and regards,
Ashish



"Mike H" wrote:

Hi,

Your sub is missing an End If but that wouldn't cause Excel to crash. I
would try restarting your PC.

Mike

"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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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
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
Conditional formatting causing Excel to crash No Name Excel Discussion (Misc queries) 3 October 10th 08 03:35 PM
cell change event gvm Excel Worksheet Functions 3 September 20th 05 04:50 AM
cell value change event alinasir Excel Worksheet Functions 1 August 30th 05 10:57 AM
Macro Glitch Causing Crash Danimagus Excel Discussion (Misc queries) 1 June 6th 05 06:19 PM
Charts causing program to crash Fysh Charts and Charting in Excel 1 December 16th 04 10:12 PM


All times are GMT +1. The time now is 06:54 PM.

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

About Us

"It's about Microsoft Excel"