Double click problem

MOB

Well-known Member
Joined
Oct 18, 2005
Messages
1,055
Office Version
  1. 365
Platform
  1. Windows
Whenever I double click on any cell of any workbook (existing or new) excel opens a specific file on its own!!

I have been playing around with this code today;

Code:
Sub Auto_Open()
    On Error Resume Next
    Application.OnDoubleClick = "updateFromLeft"
 
End Sub
Sub updateFromLeft()

    Dim WasProtected As Boolean
    On Error GoTo myhandler
 
    If ActiveCell.Row = 4 And ActiveCell.Column > 9 And ActiveCell.Column < 40 Then
    
 Dim response As VbMsgBoxResult
response = MsgBox("Are you sure you want to copy yesterday's data over?", vbYesNo)
If response = vbNo Then Exit Sub
         
        If ThisWorkbook.ActiveSheet.ProtectContents = True Then
            ThisWorkbook.ActiveSheet.Unprotect Password:="grange"
            WasProtected = True
        Else
            WasProtected = False
        End If
            ActiveCell.Offset(, -1).EntireColumn.Copy Destination:=ActiveCell.EntireColumn
        If WasProtected Then ThisWorkbook.ActiveSheet.Protect Password:="grange"
        Exit Sub
    Else
        Application.SendKeys "{F2}"
        Exit Sub
    End If
 
myhandler:
    If Application.ScreenUpdating <> True Then Application.ScreenUpdating = True
    Application.SendKeys "{F2}"
End Sub

Not sure if this is the cause, if not, how can I fix this?

Thanks in advance
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Right.......closing excel completely resolved it.

Any ideas why this was happening and if it may return?
 
Upvote 0
Why are you using this line:
Code:
Application.OnDoubleClick = "updateFromLeft"
that is the cause of your problem.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,867
Members
449,053
Latest member
Mesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top