PDA

View Full Version : doubleclick doesn't work



hiflier
03-03-2015, 02:57 AM
I have a program to create and use loan spreadsheets. The main workbook holds most of the code, and a second workbook holds all of the loan sheets. In the main workbook I list all of the loans, and double clicking on a loan name accesses the proper loan sheet in the loan workbook. All worked well until I wanted to make a large change so I created another folder to hold a test version. I changed the location of the loan data from C:\Loan Data\ to C:\Loan Data Test\ and changed the program to reflect the change. Now when I doubleclick on the loan name it doesn't go there. It doesn't even fire the doubleclick routine. I put a stop in the doubleclick routine and it showed that it doesn't even go there. I go back to the real program and it works well. So why won't the test work? Just to make sure, I turned on application.screenupdating and application.enableevents in the immediate window, still doesn't work. I looked at "allow editing in cells" in the options menu and it was checked, as it has always been. Does anyone have any ideas about why this is happening? Thanks.

Bob Phillips
03-03-2015, 05:13 AM
Can you post the workbooks?

Paul_Hossler
03-03-2015, 09:19 AM
Any chance the Double Click event handler still references the original WB name or location somehow?

hiflier
03-03-2015, 08:33 PM
The workbook is quite involved. But the handler is here:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim wbP As Workbook
Dim wbD As Workbook
Dim shP As Worksheet
Dim shD As Worksheet

Set wbP = Workbooks("C:\MHP Loan Work\Master MHP Loan Program.xlsm")
Set wbD = Workbooks("C:\MHP Loan Work\Loan Data.xlsm")
Set shP = wbP.Sheets("Maintenance")
Cancel = True
If ActiveCell.Column = 3 And ActiveCell.Row > 5 And ActiveCell.Row <= Cells(1, 26) Then '.End(xlDown).Row Then 'The following activates the proper loan sheet
LoanName = Sheets("Maintenance").Cells(ActiveCell.Row, 3)
On Error Resume Next
MyName = LoanName & " Amort"
LastCell = wbD.Sheets(LoanName).Range("A300").End(xlUp).Row
wbD.Sheets(LoanName).Range("A" & LastCell).Select
wbD.Sheets(LoanName).Activate
End If
If (ActiveCell.Column > 2 And ActiveCell.Column < 8) And ActiveCell.Row > 5 And ActiveCell.Row < Cells(1, 26) + 1 Then 'This changes the color back to normal
Call FillNoFill
End If
Cancel = False
End Sub


But the problem is that this doesn't even fire at all when the cell is double clicked.

hiflier
03-03-2015, 08:46 PM
I thought it might be the wrong folder referenced for the loans. But that's not it. Another section of the program adds up all the loan balances, and it works fine. So it's seeing the loan data.

Bob Phillips
03-04-2015, 01:22 AM
Seeing the double-click code doesn't really help, it is going to be where the code is, other code that disables events or the like.

jonh
03-04-2015, 03:26 AM
try adding the folder to trusted locations

file > options > trust center > settings > trusted locations