Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default 2003--2007 recognize if i'm in 2007 or 2003 via code.


hi,
i have macro that works on 2003, in run time, it opens an excel file, made
some changes and should save. i need the same macro to run on 2003 and 2007,
and save the file in .xls(in 2003) or .xlm(in 2007).
how should i recognize if i'm in 2007 or 2003 via the code?
and how should i re write the following code that was only for 2003:
ActiveSheet.SaveAs FileName:=ModelPath & "\" & "Service Request " & ".xls"
thanks,



--
Miri Tz.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default 2003--2007 recognize if i'm in 2007 or 2003 via code.

i have macro that works on 2003, in run time, it opens an excel file, made
some changes and should save. i need the same macro to run on 2003 and
2007,
and save the file in .xls(in 2003) or .xlm(in 2007).
how should i recognize if i'm in 2007 or 2003 via the code?


If Application.Version = "11.0" Then
MsgBox "Using XL2003
ElseIf Application.Version = "12.0" Then
MsgBox "Using XL2007"
Else
MsgBox "Not using either XL2003 nor XL2007"
End If

Rick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 2003--2007 recognize if i'm in 2007 or 2003 via code.

Can I just use that to say if version 11 save as xls else if version save as
xlm (or xlsm?)?

"Rick Rothstein (MVP - VB)" wrote:

i have macro that works on 2003, in run time, it opens an excel file, made
some changes and should save. i need the same macro to run on 2003 and
2007,
and save the file in .xls(in 2003) or .xlm(in 2007).
how should i recognize if i'm in 2007 or 2003 via the code?


If Application.Version = "11.0" Then
MsgBox "Using XL2003
ElseIf Application.Version = "12.0" Then
MsgBox "Using XL2007"
Else
MsgBox "Not using either XL2003 nor XL2007"
End If

Rick


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 2003--2007 recognize if i'm in 2007 or 2003 via code.

Hi Debbie

See
http://www.rondebruin.nl/saveas.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Debbie Horner" wrote in message ...
Can I just use that to say if version 11 save as xls else if version save as
xlm (or xlsm?)?

"Rick Rothstein (MVP - VB)" wrote:

i have macro that works on 2003, in run time, it opens an excel file, made
some changes and should save. i need the same macro to run on 2003 and
2007,
and save the file in .xls(in 2003) or .xlm(in 2007).
how should i recognize if i'm in 2007 or 2003 via the code?


If Application.Version = "11.0" Then
MsgBox "Using XL2003
ElseIf Application.Version = "12.0" Then
MsgBox "Using XL2007"
Else
MsgBox "Not using either XL2003 nor XL2007"
End If

Rick



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel opens two windows (2007 & 2003 format): I want only 2003. Rob Excel Discussion (Misc queries) 0 March 6th 10 07:46 PM
Saving from 2007 to 2003 - 2003 won't open the file James Piper Excel Discussion (Misc queries) 0 February 2nd 10 02:56 PM
visual basic code in 2003 vs 2007 George Applegate[_2_] Excel Discussion (Misc queries) 1 October 30th 09 05:07 PM
Why can't I sort a 2003 file in 2007? 2007 freezes. lw2007 Excel Discussion (Misc queries) 0 April 27th 09 07:41 PM
2007 & 2003 - Default open with 2003 JudithJubilee Excel Discussion (Misc queries) 4 June 6th 08 04:18 PM


All times are GMT +1. The time now is 10:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"