預設檔案格式 的登錄值 defaultformat (excel\options)使用者HKCU\software\policies\microsoft\office\16.0\excel\options

原則 ID
L_SaveExcelfilesas
適用範圍
使用者設定
支援的作業系統
至少需要 Windows Server 2008 R2 或 Windows 7
來源
Microsoft 365 Apps / Office Administrative Templates (版本 5568.1000)
類別
Microsoft Excel 2016 › Excel 選項 › 儲存

登錄

defaultformat

REG_DWORD使用者
啟用時的值
取決於選項值
元素
將 Excel 檔儲存為
選項
項目儲存的值
Excel 活頁簿 (*.xlsx)51
Excel 啟用巨集的活頁簿 (*.xlsm)52
Excel 二進位活頁簿 (*.xlsb)50
網頁 (*.htm; *.html)44
Excel 97-2003 活頁簿 (*.xls)56
Excel 5.0/95 活頁簿 (*.xls)39
OpenDocument 試算表 (*.ods)60
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\options]

; 選項 (只使用其中一個)
; Excel 活頁簿 (*.xlsx)
"defaultformat"=dword:00000033
; Excel 啟用巨集的活頁簿 (*.xlsm)
"defaultformat"=dword:00000034
; Excel 二進位活頁簿 (*.xlsb)
"defaultformat"=dword:00000032
; 網頁 (*.htm; *.html)
"defaultformat"=dword:0000002c
; Excel 97-2003 活頁簿 (*.xls)
"defaultformat"=dword:00000038
; Excel 5.0/95 活頁簿 (*.xls)
"defaultformat"=dword:00000027
; OpenDocument 試算表 (*.ods)
"defaultformat"=dword:0000003c
CMD
:: 選項 (只使用其中一個)

:: Excel 活頁簿 (*.xlsx)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\options" /v "defaultformat" /t REG_DWORD /d 51 /f
:: Excel 啟用巨集的活頁簿 (*.xlsm)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\options" /v "defaultformat" /t REG_DWORD /d 52 /f
:: Excel 二進位活頁簿 (*.xlsb)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\options" /v "defaultformat" /t REG_DWORD /d 50 /f
:: 網頁 (*.htm; *.html)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\options" /v "defaultformat" /t REG_DWORD /d 44 /f
:: Excel 97-2003 活頁簿 (*.xls)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\options" /v "defaultformat" /t REG_DWORD /d 56 /f
:: Excel 5.0/95 活頁簿 (*.xls)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\options" /v "defaultformat" /t REG_DWORD /d 39 /f
:: OpenDocument 試算表 (*.ods)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\options" /v "defaultformat" /t REG_DWORD /d 60 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\options' -Force | Out-Null

# 選項 (只使用其中一個)
# Excel 活頁簿 (*.xlsx)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\options' -Name 'defaultformat' -PropertyType DWord -Value 51 -Force | Out-Null
# Excel 啟用巨集的活頁簿 (*.xlsm)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\options' -Name 'defaultformat' -PropertyType DWord -Value 52 -Force | Out-Null
# Excel 二進位活頁簿 (*.xlsb)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\options' -Name 'defaultformat' -PropertyType DWord -Value 50 -Force | Out-Null
# 網頁 (*.htm; *.html)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\options' -Name 'defaultformat' -PropertyType DWord -Value 44 -Force | Out-Null
# Excel 97-2003 活頁簿 (*.xls)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\options' -Name 'defaultformat' -PropertyType DWord -Value 56 -Force | Out-Null
# Excel 5.0/95 活頁簿 (*.xls)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\options' -Name 'defaultformat' -PropertyType DWord -Value 39 -Force | Out-Null
# OpenDocument 試算表 (*.ods)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\options' -Name 'defaultformat' -PropertyType DWord -Value 60 -Force | Out-Null