How do I prevent Excel from locking files by default?

I was able to reach a satisfactory conclusion to this by adding the following keys to my registry:

[HKEY_CLASSES_ROOT\Excel.CSV\shell\Open_in_read_only_Excel]
@="Open read-only in Excel"

[HKEY_CLASSES_ROOT\Excel.CSV\shell\Open_in_read_only_Excel\command]
@="\"C:\\Program Files (x86)\\Microsoft Office\\Office12\\EXCEL.EXE\" /r \"%1\""

These create an entry on the right-click shell menu in Windows Explorer called "Open read-only in Excel". When selected, this launches Excel with the /r flag (as per the command in the second key), which opens the file in read-only mode.

This is not perfect - I would rather that this were the default action for a CSV file, and that a context option was needed to launch in read-write mode. However it is a vast improvement on the situation before.


Here's the equivalent of Andrzej Doyle's answer for Excel 2013, which uses DDE, and also sets "Open (read-only)" as the default action:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Excel.CSV\shell]
@="OpenReadOnly"

[HKEY_CLASSES_ROOT\Excel.CSV\shell\OpenReadOnly]
@="Open (read-only)"

[HKEY_CLASSES_ROOT\Excel.CSV\shell\OpenReadOnly\command]
@="\"C:\\Program Files\\Microsoft Office 15\\Root\\Office15\\EXCEL.EXE\" /dde"

[HKEY_CLASSES_ROOT\Excel.CSV\shell\OpenReadOnly\ddeexec]
@="[open(\"%1\" /ou \"%u\",,1)]"

[HKEY_CLASSES_ROOT\Excel.CSV\shell\OpenReadOnly\ddeexec\topic]
@="system"

(Yes, it's the ,,1 that makes the file read-only. How obscure!)


There is a lightweight program from Microsoft themselves called Microsoft Excel Viewer. (just google) This does not lock files when viewing them. It can be installed even if full size Microsoft Excel is present.

Unfortunately I have not yet found how to set windows to use the 'Viewer' as its default Excel application (unless I uninstall full size Excel). If I could do that we would all have a very neat solution. So does anyone know how to do that?