PC Review


Reply
Thread Tools Rate Thread

How to automatically covert excel version by coding

 
 
=?Utf-8?B?Y29weWNhdA==?=
Guest
Posts: n/a
 
      20th Nov 2007
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 With Quote
 
 
 
 
=?Utf-8?B?c2ViYXN0aWVubQ==?=
Guest
Posts: n/a
 
      20th Nov 2007
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Covert a workbook from Excel 2000 to Excel 2007 current file forma Prommin Supho Microsoft Excel Misc 2 4th Mar 2009 03:47 AM
Covert 9 digits to 10 in excel Lisalala Microsoft Excel Misc 2 7th Aug 2008 09:17 AM
Can't covert Excel to Outlook =?Utf-8?B?U1N0b25l?= Microsoft Outlook Discussion 0 27th Jun 2006 08:54 PM
Can't covert my trial version into full product. Help ! =?Utf-8?B?TGlseTIwMDQ=?= Microsoft Word Document Management 2 29th Mar 2006 08:00 AM
How does excel automatically covert cells when a different number. =?Utf-8?B?dGFsaWw=?= Microsoft Excel Misc 1 17th Mar 2005 06:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:08 AM.