Identify What Version of Excel is Installed

bisel

Active Member
Joined
Jan 4, 2010
Messages
257
Office Version
  1. 365
Platform
  1. Windows
I have a need to determine if the user's installed version of Excel will support specific features. Upon opening a workbook, I am trying to collect information ...
  • The Excel Version number
  • The Excel Product Code
  • The Excel Build Number
  • The Operating System identifier

I am using the following in a macro that runs when the user opens the workbook ...

Rich (BB code):
Sub checkexcel()
     Dim excelname as String
Dim excelVersion As String​
Dim excelBuild As String​
Dim excelProductCode As String​
Dim osp As String​
excelname = Application.Application excelVersion = Application.Version​
excelBuild = Application.Build excelProductCode = Application.productCode osp = Application.OperatingSystem end sub

When I run the macro, I get the following results:

Application.Application = Microsoft Excel
Application.Version = 16.0
Application.Build = 18324
Application.ProductCode = {90160000-000F-0000-1000-0000000FF1CE}
Application.OperatingSystem = Windows (64-bit) NT 10.00

I am hoping to be able differentiate between Excel 2016, 2019, 2021, 2024 and 365. But all these have Application.Version = 16.0

Looking into the build numbers and I am finding similar problems. That is, I cannot find a reference of build numbers that differentiate between Excel's. Perhaps there is such a thing, but I cannot find them. Lastly, my PC is running Windows 11, but Application.OperatingSystem yields the result shown above.

Does anyone have a solution on how I can perform the query upon opening an Excel Workbook to obtain the details I am looking for?

Thanks,

Steve
 
Last edited by a moderator:

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
VBA Code:
Function GetVersion() As String
    Dim verNo As Integer
    verNo = VBA.Val(Application.Version)
    Select Case verNo
        Case 8:
        GetVersion = "Excel 97"
        Case 9:
        GetVersion = "Excel 2000"
        Case 10:
        GetVersion = "Excel 2002"
        Case 11:
        GetVersion = "Excel 2003"
        Case 12:
        GetVersion = "Excel 2007"
        Case 14:
        GetVersion = "Excel 2010"
        Case 15:
        GetVersion = "Excel 2013"
        Case 16:
        GetVersion = "Excel 2016"
        Case Else:
        GetVersion = "Excel Unknown Version”"
    End Select
End Function
 
Upvote 0
Supposedly, this is a big problem. There doesn't seem to be a good answer. The most useful post I found is here:


In particular, after the article, look at posts 9 and 39. The registry key listed in post 9 exists on my version, and it says HomeStudent2021Retail. You could adapt the macro in the article to read that registry key. But post 39 states that even that may not be reliable, and he comes up with an alternate method to determine the version based on what functions were added to each version.
 
Upvote 0
VBA Code:
Function GetVersion() As String
    Dim verNo As Integer
    verNo = VBA.Val(Application.Version)
    Select Case verNo
        Case 8:
        GetVersion = "Excel 97"
        Case 9:
        GetVersion = "Excel 2000"
        Case 10:
        GetVersion = "Excel 2002"
        Case 11:
        GetVersion = "Excel 2003"
        Case 12:
        GetVersion = "Excel 2007"
        Case 14:
        GetVersion = "Excel 2010"
        Case 15:
        GetVersion = "Excel 2013"
        Case 16:
        GetVersion = "Excel 2016"
        Case Else:
        GetVersion = "Excel Unknown Version”"
    End Select
End Function
Thank you for replying, however, this is not what I am looking for. To be more specific, There is a difference between the currently supported versions of Excel (2016 and higher). The issue is that I want to be able to obtain the version number and the build number. For example, on my copy of Excel 365 ...

1737438666996.png

I have found a couple of ways to obtain the Build Number using VBA ... for exemple

Application.Version will return "16.0" and Application.Build returns "18324"

It is my understanding that the Version Number (2412) shown above is interpreted as December 2024 (24 = last 2 digits of the year and 12 = month number). So to interpret my install, I have Excel 365, last updated in December 2024 with the build number of 18324.

What I am looking for is way to derive if the user has Excel 2016, 2019, 2021, 2024 or 365 and the corresponding build number.

Thanks,

Steve
 

Attachments

  • 1737438049405.png
    1737438049405.png
    88.3 KB · Views: 2
Upvote 0
My first question is why? What are you actually attempting to check for?
 
Upvote 0
My first question is why? What are you actually attempting to check for?
The reason I want to obtain this information is that I have an application that I market. The recently deployed function where the user can insert an image directly inside a cell instead of over the top of the cells was made available to users of Excel 2024 and Excel 365 ... above a certain build number. The function is not available in Excel 2016, 2019 and 2021. At least I do not believe it is.

I was hoping to be able to determine the product identifier, version, and build of the user's installed Excel and test it to see if the user's copy of Excel supports what I am trying to do.

I came up with an idea that may work for me.

I am thinking of inserting in the workbook startup macro a short of the VBA code to use the IMAGE function and then trap the error. If an error is generated then do A. If no error than do B. The "IMAGE" function is only available in Excel 2024 and Excel 365. My thought is that if the user can get past this small bit of code, then their copy of Excel will support what I am trying to do.

Regards,

Steve
 
Upvote 0
Are you talking about the IMAGE() function, or the Insert picture in cell functionality?
 
Upvote 0
Why not check to see if it returns a NAME error?

Change the URL to something you know will always exist.
VBA Code:
Function ImageFunctionSupported() As Boolean
Range("IV2").Formula = "=IMAGE(""https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"")"
ImageFunctionSupported = Range("IV2").Text <> "#NAME?"
Range("IV2").ClearContents
End Function

Sub Test()
MsgBox ImageFunctionSupported
End Sub
 
Upvote 0
I am probably old fashioned but my first reaction is to build something that works on all systems.
But then I don't know how important it is to have a picture inside a cell on one system and on top of the cell in another system.
I think it was Mr Hawley (RIP) who advocated KISS
 
Upvote 0

Forum statistics

Threads
1,225,735
Messages
6,186,716
Members
453,369
Latest member
positivemind

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top