Application.VBE.Version on Excel XP

  • Thread starter Thread starter Jeremy
  • Start date Start date
J

Jeremy

Hi,

I've been using Application.VBE.Version to determine which version of
excel my macros are running on sine office 98. I'm just migrating to
Office XP and I am getting a runtime error 1004, Application-defined or
object-defined error.

Sub testit()
MsgBox "Welcome to Microsoft Excel version " & _
Application.Version & _
" running on " & _
Application.OperatingSystem & "!"
End Sub

When I run this, I get "10.0" and "Windows (32-bit) NT 5.01" returned
appropriately. When I change Application.Version to
Application.VBE.Version I get the runtime error.

Has anyone seen anything like this before or can anyone offer some
advice?

Thank you,

Jeremy.
 
I have never seen VBE.Version, but application.Version has always worked.
Maybe VBE.Version was a fluke and the fixed it.
 
Roedd said:
Hi,

I've been using Application.VBE.Version to determine which version of
excel my macros are running on sine office 98. I'm just migrating to
Office XP and I am getting a runtime error 1004, Application-defined
or object-defined error.

Excel 97:
?application.Version
8.0e
?Application.VBE.Version
5.00

Excel 2000
?application.Version
9.0
?Application.VBE.Version
6.04

Excel XP
?application.Version
10.0
?Application.VBE.Version
6.04

I don't have Office 2003 installed.

--
Rob

http://www.asta51.dsl.pipex.com/webcam/

This message is copyright Robert Bruce and intended
for distribution only via NNTP.
Dissemination via third party Web forums with the
exception of Google Groups and Microsoft Communities
is strictly prohibited and may result in legal action.
 
I see I was looking in the wrong library (Visual basic extensions) and this
is in the Excel Library. As Rob/Dave show, it works in all versions
(although it doesn't appear to be of much utility).
 
Tom Ogilvy said:
I see I was looking in the wrong library (Visual basic extensions) and this
is in the Excel Library. As Rob/Dave show, it works in all versions
(although it doesn't appear to be of much utility).
On the Trusted Publishers dialog I had to check Trust access to Visual Basic
Project.

Now it works.

Jeremy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top