Microsoft は最近、Excel のバージョンと現在の omacro セキュリティ レベルを読み取るために、長年の (そして公式に推奨されている) コードを壊しました。
以前は機能していたもの:
// Get the program associated with workbooks, e.g. "C:\Program Files\...\Excel.exe"
SHELLAPI.FindExecutable( 'OurWorkbook.xls', ...)
// Get the version of the .exe (from it's Properties...)
WINDOWS.GetFileVersionInfo()
// Use the version number to access the registry to determine the security level
// '...\software\microsoft\Office\' + VersionNumber + '.0\Excel\Security'
(セキュリティレベルが安全でないレジストリエントリで何年もの間だったことをいつも面白がっていました...)
Office 2010 では、.xls ファイルは「Microsoft Application Virtualization DDE Launcher」または sftdde.exe に関連付けられるようになりました。この exe のバージョン番号は、明らかに Excel のバージョンではありません。
私の質問:
実際に Excel を起動し、バージョンとセキュリティレベルをクエリする (OLE CreateOLEObject('Excel.Application') を使用) 以外に、Excel 2003 以降のすべてのバージョンで機能する、クリーンで高速、または信頼性の高い方法はありますか? ?