Excel crashing on opening

Chewyhairball

Active Member
Joined
Nov 30, 2017
Messages
312
Office Version
  1. 365
Platform
  1. Windows
Hi
I recently added the following to Workbook_Open to run when opening the sheet

VBA Code:
Application.MoveAfterReturn = False


when i try and open my file now it crashes. If i open it in safe mode and remove this line of code it works again.

Why would this line of code crash the sheet when opening?

thanks

Rory
 

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.
Maybe it is conflicting with another event. Try:
VBA Code:
Private Sub Workbook_Open()
  Application.EnableEvents = False
  Application.MoveAfterReturn = False
  Application.EnableEvents = True
End Sub
 
Upvote 0
I am just curious, on your profile you are running 2 versions of Excel. Is it happening on MS365 or O2016 ?
 
Upvote 0

Forum statistics

Threads
1,215,586
Messages
6,125,689
Members
449,250
Latest member
azur3

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