Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2009, 09:08 AM
ppenn
Guest
 
Posts: n/a
Default SAving into Excel 2003 or 2007

Hi

We are currently migrating our users from Office 2003 to 2007.
I have worksheets which include VBA modules, as some users are using 2003 and some 2007 I need the code to recognise the version being used, so that the code will save it correctly.
2003 needs to be "FileFormat:=xlNormal" and
2007 needs to be "FileFormat:=xlOpenXMLWorkbookMacroEnabled"

Any assistance would be gratefully received

Regards
Peter
 
Old August 12th, 2009, 09:19 AM
Authorized User
 
Join Date: Nov 2007
Posts: 48
Thanks: 0
Thanked 4 Times in 4 Posts
Default

ppenn,

This should help you get started in the right direction.

This will return the Excel version the user is using.

Code:
 
Sub ReturnExcelVersion()
    If Application.Version = "12.0" Then
        MsgBox "You are using Excel 2007."
    ElseIf Application.Version = "11.0" Then
        MsgBox "You are using Excel 2003."
    ElseIf Application.Version = "10.0" Then
        MsgBox "You are using Excel 2002."
    ElseIf Application.Version = "9.0" Then
        MsgBox "You are using Excel 2000."
    ElseIf Application.Version = "8.0" Then
        MsgBox "You are using Excel 97."
    ElseIf Application.Version = "7.0" Then
        MsgBox "You are using Excel 95."
    End If
End Sub

Have a great day,
Stan
__________________
stanleydgromjr

Windows 8.1, Excel 2007.
The Following User Says Thank You to stanleydgromjr For This Useful Post:
 
Old August 12th, 2009, 09:35 AM
ppenn
Guest
 
Posts: n/a
Default Thanks very much

Works okay

Seems so simple when you know how

Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2007 vba UDF DavidReese BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 1 February 24th, 2009 01:10 AM
Excel 2000 upgrade to Excel 2007 poyserr Excel VBA 0 October 27th, 2008 10:51 AM
Difference btw. Access 2000, 2003, 2007 marcusalan Access ASP 0 May 26th, 2007 02:41 AM
EXCEL question saving a file saving the the first macupryk VS.NET 2002/2003 0 January 6th, 2005 05:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.