Can you help me to build a script which will check the version of excel install using registry and set to open a application report where excel start.
Can you help me to build a script which will check the version of excel install using registry and set to open a application report where excel start.
Hi,
Is it Microsoft Office or Office 365? What do you mean by "application report"? An Excel spreadsheet?
Hi Team,
its a xlam file needs to open and below registry to be created based on the excel version.
- create registry key to open AddIn when starting Excel:
Key: "HKCU\Software\Microsoft\Office\x.x\Excel\Options\OPEN" (x.x is version number)
Value: name of the found .xlam file
Type: "REG_SZ"
Hi,
You can get the version of Office like this
$version = Get-WmiObject -Class Win32_Product -Filter "name like 'Microsoft Office Professional%'" | Select-Object -ExpandProperty Version
If it's Office 365 you can try
$version = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration' | Select-Object -ExpandProperty VersionToReport
To create a registry value you can use the New-ItemProperty cmdlet
$version -match '\d+.\d'
$ver = $Matches.Values
New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\$ver\Excel\Options" -Name "OPEN" -Value $filename -PropertyType String
Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hello Lan Xue,
Thanks for the prompt help.
we use 0365 product.
I belive this script will not detect x64 bit registry.
"HKLM:Software\Wow6432Node\Microsoft\Office\11.0\Excel"
can you help me to create a check like this.
"HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration' or this "HKLM:Software\Wow6432Node\Microsoft\Office\version\Excel"
"HKLM:\Software\Wow6432Node" is for 32-bit applications that run on a 64-bit version of Windows.
can you help me check for 32 bit as well..if in case we have any machine running office with 32 bit
10 people are following this question.