question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable users to detect if add-in is running in Excel 2019 or 365

See original GitHub issue

Microsoft decided not to bump the version number of Excel in Office 2019 and Office 365 and for this reason, the ExcelDnaUtil.ExcelVersion returns 16 for Excel 2016 or 2019 or 365 and users cannot easily tell which version of Excel their add-in is running other than knowing it’s >= 2016

Excel2003 = 11 => Office 2003
Excel2007 = 12 => Office 2007
Excel2010 = 14 => Office 2010
Excel2013 = 15 => Office 2013
Excel2016 = 16 => Office 2016 or 2019 or 365

In terms of API, I think it makes sense to leave ExcelDnaUtil.ExcelVersion as is, and introduce a new property in ExcelDnaUtil e.g. ExcelVersionName that returns a string with the Office version e.g. Excel 2013, Excel 2019, etc.


ps: This does not affect our MSBuild tasks because we only attempt to detect the version of Excel in order to find where EXCEL.EXE is located, in order to determine the bitness, and the registry key continues to be the same as Excel 2016 for Excel 2019 & 365.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
govertcommented, Jul 14, 2020

This is the result of FileVersionInfo.GetVersionInfo(Process.GetCurrentProcess().MainModule.FileName)

Comments: 
CompanyName: Microsoft Corporation
FileBuildPart: 13102
FileDescription: Microsoft Excel
FileMajorPart: 16
FileMinorPart: 0
FileName: C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE
FilePrivatePart: 20002
FileVersion: 16.0.13102.20002
InternalName: Excel
IsDebug: False
IsPatched: False
IsPrivateBuild: False
IsPreRelease: False
IsSpecialBuild: False
Language: Language Neutral
LegalCopyright: 
LegalTrademarks: 
OriginalFilename: Excel.exe
PrivateBuild: 
ProductBuildPart: 13102
ProductMajorPart: 16
ProductMinorPart: 0
ProductName: Microsoft Office
ProductPrivatePart: 20002
ProductVersion: 16.0.13102.20002
SpecialBuild: 
0reactions
govertcommented, Jul 14, 2020

To be clear - my objection was not about adding a helper to get detailed version information, but about the fact the “Excel 2019” vs. “Office 365” is not a useful distinction. Ideally we’d want two sets of information, the version from the File -> Account screen showing the build, channel and install mode: Version 2008 (Build 131202.20002 Click-to-Run) and then also the About info Microsoft Excel for Microsoft 365 MSO (16.0.131202.20002) 32-bit

I guess one would have to trawl through the registry to find the relevant bits and pieces.

(And even then, this is not enough for feature detection like knowing whether the Dynamic Arrays of StockHisotory is supported in the running instance.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

View, manage, and install add-ins for Microsoft 365 programs
Click More Add-ins>Manage My Add-ins. Click Trust Center > Trust Center Settings > Add-ins. Check or uncheck the boxes you want.
Read more >
User not seeing add-ins - Microsoft 365
Then select the Admin Managed tab along the top in the Office Add-ins window. If add-in is not there, select Refresh in the...
Read more >
Support for keeping add-ins enabled
Programs in Office 2013 and later versions provide add-in resiliency, meaning that apps will disable an add-in if it performs slowly.
Read more >
Add or remove add-ins in Excel
Add or remove an Excel add-in · Click File > Get Add-ins. Alternatively, you can click Home > Add-ins. · You can directly...
Read more >
Determine if Centralized Deployment of add-ins works for ...
Using the Centralized Deployment Compatibility Checker, you can verify whether the users on your tenant are set up to use Centralized Deployment ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found