Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to automatically covert excel version by coding

I have some excel5 files to work on,
but some function only works in newer version.
so how do covert excel version, say use "saveas"?
any clue?thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default How to automatically covert excel version by coding

Hi,
Say you want to sort a range but the Range.Sort method either doesn't exist
or has different parameter lists depending of the XL version. You could then
use a general Object data type instead of a Range. This will make the code
compile properly.

Dim obj as Object
Dim version as string

version=application.Version
set obj = Activesheet.Range("A1:F100") ''' range to sort

if Version= "9" then
obj.Sort ..... xl2k: with a specific list of parameters
elseif version="10" or version ="11"
obj.Sort .... xl 2002 & xl 2003: with another list of parameters
elseif version ="12"
obj.Sort ..... xl 2007... same idea
else ''' prior to xl2k
''' let's say Range.Sort doesn't exist prior to 2k then write your
own code here
''' or pop a message to the user saying it cannot be done in this
version
''' <code
end if
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"copycat" wrote:

I have some excel5 files to work on,
but some function only works in newer version.
so how do covert excel version, say use "saveas"?
any clue?thanks

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
Covert 9 digits to 10 in excel Lisalala Excel Discussion (Misc queries) 2 August 7th 08 09:17 AM
Macro - Save an Open Excel Version 4 as current version of Excel planomax Excel Programming 1 February 6th 07 09:41 PM
how do I save the files automatically when I work in 2000 version Jenny Ma Excel Discussion (Misc queries) 1 January 5th 06 11:47 AM
Recover earlier version of excel sheet after new version saved? stephanie38 Excel Discussion (Misc queries) 3 June 17th 05 03:52 AM
How does excel automatically covert cells when a different number. talil Excel Discussion (Misc queries) 1 March 17th 05 06:49 AM


All times are GMT +1. The time now is 02:14 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"