Share via

VBA Version Numbers

Anonymous
2013-12-06T12:38:24+00:00

I have been able to find the Excel version number as follows:

Dim strAppVersion As String

strAppVersion = Application.Version

I believe they can be cross-referenced as follows:

A simple case entry would return a user-friendly reply.

5 = Excel 5

6 = Excel 6

7 = Excel 95

8 = Excel 97

9 = Excel 2000

10 = Excel 2002

11 = Excel 2003

12 = Excel 2007

14 = Excel 2010

15 = Excel 2013

But what about the Visual Basic version?

Are they released in pairs? If so, can anyone complete the table for me?

I am using Excel 2003 and VB 6.5

How can I code VBA to return its own version number?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2013-12-06T14:17:54+00:00

EXcel 2003 for me.

 

I pasted your code into a new empty module.

 

Method 'VBE' of object 'Application' failed.

In excel 2003 while on a worksheet i.e. not in VB editor try this

Tools | Options | Security tab | Macro Security | Trusted Publishers tab and Check 'Trust access to visual basic project' and then try the code again.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

7 additional answers

Sort by: Most helpful
  1. Anonymous
    2013-12-06T14:12:31+00:00

    EXcel 2003 for me.

    I pasted your code into a new empty module.

    Method 'VBE' of object 'Application' failed.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-12-06T13:50:20+00:00

    That's strange, it works fine for me with XL2003

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-12-06T13:47:16+00:00

    Sorry,

    Returns a 'Run-Time Error'.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-12-06T13:37:57+00:00

    HI

    Try this:

    Sub cc()

    Dim strAppVersion As String

     strAppVersion = Application.VBE.Version

    MsgBox strAppVersion

    End Sub

    Was this answer helpful?

    0 comments No comments