Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identifying Excel version programmatically

Tags:

.net

excel

vb.net

My VB.NET (3.5) application generates Excel reports.

Newer versions of Excel support the Office Open XML file format, while older versions don't.

I'd like my application to identify which version of Excel is installed on the local machine, and use a different method for generating the report (Newer versions: by generating an XML file. Older versions: by utilizing Excel Automation).

How can I identify the Excel version installed on the local machine?

like image 844
M.A. Hanin Avatar asked Apr 10 '11 15:04

M.A. Hanin


People also ask

Is Excel 2016 the same as Excel 2019?

You will discover various differences in Excel 2016 and Excel 2019. For example, in Excel 2019 it is possible to use various new or improved functions such as MAXIFS, TEXTJOIN, CONCAT and SWITCH. Furthermore, completely new graphs and diagrams have been added.

How can I tell what version of Excel 2010 I have?

Excel 2010 Start by clicking the File tab of the ribbon and then click Help at the left side of the screen. You'll see all the version information appear at the right side of the screen.

What is version 2107 Excel?

Version 2107 (Build 14228.20250) Among the bugs fixed are one in Excel that caused some linked Dynamics tables to stop responding and one in multiple Office apps in which document exports to PDF or XPS formats stopped responding due to recent updates. The security updates are for Word and the entire Office suite.


2 Answers

You could open an instance of Excel and check the version:

Dim appExcel As Object
appExcel = CreateObject("Excel.Application")
With appExcel
    Debug.Print(Val(.application.version))
    .quit()
    appExcel = Nothing
End With
like image 82
Doug Glancy Avatar answered Oct 07 '22 19:10

Doug Glancy


You can have a look at one of the following registry keys :

HKEY_USERS\.DEFAULT\Software\Microsoft\Office\11.0\Excel 
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel

You should look for the existence of the key, with "Excel" in it, as you can have office 2003 installed, and visio 2007 aside, so both keys will exist, but only one will have an Excel subkey :

HKEY_CURRENT_USER\Software\Microsoft\Office\11.0
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0

Number / Version correspondance

  • Office 9 : Office 2000
  • Office 10 : Office XP (First version to support XML format worksheets)
  • Office 11 : Office 2003
  • Office 12 : Office 2007
  • Office 14 : Office 2010 (fun fact, 13 was skipped)
like image 44
mathieu Avatar answered Oct 07 '22 19:10

mathieu