View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default How can this crash Excel?

In a loaded .xla add-in I have the following code in the ThisWorkbook
module:

Option Explicit
Private WithEvents xlApp As Excel.Application

Private Sub xlApp_SheetSelectionChange(ByVal Sh As Object, ByVal Target As
Range)
On Error GoTo ERROROUT
If Len(Target.Name.Name) 10 Then
Application.StatusBar = Space(8) & Target.Name.Name
Else
Application.StatusBar = False
End If
Exit Sub
ERROROUT:
Application.StatusBar = False
End Sub

This code runs fine on many machines, but on one particular machine only
(Excel 2003, Win XP) the line
If Len(Target.Name.Name) 10 Then
crashes Excel when there is a filter in the sheet.

What possibly could be the trouble here?
I can't reproduce this at all on my machine, so difficult to unravel this
problem, but maybe somebody
has an idea.

RBS