Double click problem

MOB

Well-known Member
Joined
Oct 18, 2005
Messages
1,048
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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

MOB

Well-known Member
Joined
Oct 18, 2005
Messages
1,048
Office Version
  1. 365
Platform
  1. Windows
Right.......closing excel completely resolved it.

Any ideas why this was happening and if it may return?
 
Upvote 0

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
40,380
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Why are you using this line:
Code:
Application.OnDoubleClick = "updateFromLeft"
that is the cause of your problem.
 
Upvote 0

Forum statistics

Threads
1,191,197
Messages
5,985,231
Members
439,952
Latest member
djharter

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
Top