wesborland1234
Board Regular
- Joined
- Mar 30, 2016
- Messages
- 67
Hello,
I have a workbook, with one sheet, and some code running in the worksheet_change event. We have three copies of the worksheet on three different computers. On two of them, it works fine. On the third, when you open it up, you can click somewhere, and the event will fire. The next time you click somewhere nothing happens. And now, nothing will happen on any change, until I close and reopen the file. Here's where it gets wierder. I click on a cell, wait for the event to fire, and it doesn't. Then, when I open up Visual Basic, the event I was waiting for does fire.
The sheet name is correct, macros are enabled. I tried setting Application.EventsEnabled = true, at the beginning and end of macro, and this does not change anything.
Any ideas on what is going on here?
Also, when we attempt to exit Excel on the affected computer, nothing happens, so we have to go into task manager and close it that way.
Here is the code:
I have a workbook, with one sheet, and some code running in the worksheet_change event. We have three copies of the worksheet on three different computers. On two of them, it works fine. On the third, when you open it up, you can click somewhere, and the event will fire. The next time you click somewhere nothing happens. And now, nothing will happen on any change, until I close and reopen the file. Here's where it gets wierder. I click on a cell, wait for the event to fire, and it doesn't. Then, when I open up Visual Basic, the event I was waiting for does fire.
The sheet name is correct, macros are enabled. I tried setting Application.EventsEnabled = true, at the beginning and end of macro, and this does not change anything.
Any ideas on what is going on here?
Also, when we attempt to exit Excel on the affected computer, nothing happens, so we have to go into task manager and close it that way.
Here is the code:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Cells.Count = 1 Then
If Target.Column = 1 Then
Dim Shex As Object
Dim tgtFile As String
Dim fileName As String
fileName = Cells(Target.Row, Target.Column).Value & ".tif"
Set Shex = CreateObject("Shell.Application")
tgtFile = ThisWorkbook.Path & "\" & fileName
Shex.Open (tgtFile)
End If
End If
End Sub