Options
The value of Options
seems to be a bit-field that stores several options for excel.
For example, bit nr. 2 seems to store if the formula bar is displayed.
Setting values in the command line
The following to scripts can be used to set these values from the console (either
cmd.exe
or
PowerShell).
cmd.exe / reg.exe
The following script can be used to change some values with
reg
in
cmd.exe:
set EXCEL_VERSION=15.0
@reg add HKCU\Software\Microsoft\Office\%EXCEL_VERSION%\Excel\Options /v DefaultCPG /t REG_DWORD /d 65001 /f > nul
@reg add HKCU\Software\Microsoft\Office\%EXCEL_VERSION%\Excel\Options /v DefaultFormat /t REG_DWORD /d 34 /f > nul
@reg add HKCU\Software\Microsoft\Office\%EXCEL_VERSION%\Excel\Options /v DeveloperTools /t REG_DWORD /d 1 /f > nul
Note that the Office version needs to be adjusted in the respective variable in the batch file.
PowerShell
With PowerShell, the same thing can be achieved with
$officeVersion = (get-item hklm:\Software\Classes\excel.application\curVer).getValue('') -replace '.*\.(\d+)', '$1'
$eatMe = new-itemProperty hkcu:\Software\Microsoft\Office\$officeVersion.0\Excel\Options -name DefaultCPG -value 65001 -force
$eatMe = new-itemProperty hkcu:\Software\Microsoft\Office\$officeVersion.0\Excel\Options -name DefaultFormat -value 34 -force # default default format is 33
$eatMe = new-itemProperty hkcu:\Software\Microsoft\Office\$officeVersion.0\Excel\Options -name DeveloperTools -value 1 -force