Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Conditional Compilation Based On Excel Version

Is it possible to perform conditional compilation based on Excel version?
For example I have code that needs to continue to support XL97 but I'd like
to take advantage of new arguments to an Excel method introduced in XL2000
and later.

#If XL97 Then
abc xyz
#Else
abc xyz, lmnop
#End If

TIA

josh


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Conditional Compilation Based On Excel Version

Hi Josh,
The Vba version changed from VBA 5 to VBA 6 in Excel 2000.
New compiler constants were also created, so...

#If VBA5 Then
abc xyz
#ElseIf VBA6 Then
abc xyz, lmnop
#End If

Unfortunately, there seems to be no way to differentiate
between xl2000 and later versions using compiler constants.

Regards,
Jim Cone
San Francisco, USA


"Josh Sale" <jsale@tril dot cod
wrote in message

Is it possible to perform conditional compilation based on Excel version?
For example I have code that needs to continue to support XL97 but I'd like
to take advantage of new arguments to an Excel method introduced in XL2000
and later.

#If XL97 Then
abc xyz
#Else
abc xyz, lmnop
#End If
TIA
josh


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Conditional Compilation Based On Excel Version

#If VBA5 Then

There is no VBA5 compiler constant.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Jim Cone" wrote in message
...
Hi Josh,
The Vba version changed from VBA 5 to VBA 6 in Excel 2000.
New compiler constants were also created, so...

#If VBA5 Then
abc xyz
#ElseIf VBA6 Then
abc xyz, lmnop
#End If

Unfortunately, there seems to be no way to differentiate
between xl2000 and later versions using compiler constants.

Regards,
Jim Cone
San Francisco, USA


"Josh Sale" <jsale@tril dot cod
wrote in message

Is it possible to perform conditional compilation based on
Excel version?
For example I have code that needs to continue to support XL97
but I'd like
to take advantage of new arguments to an Excel method
introduced in XL2000
and later.

#If XL97 Then
abc xyz
#Else
abc xyz, lmnop
#End If
TIA
josh




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Conditional Compilation Based On Excel Version

Chip,

Thanks Chip, you are so right.
That code should read...

#If VBA6 Then
abc xyz, lmnop
#Else
abc xyz
#End If

Regards,
Jim Cone


"Chip Pearson"
wrote in message
...
#If VBA5 Then


There is no VBA5 compiler constant.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Conditional Compilation Based On Excel Version

Thanks!

Exactly what I needed!!

josh




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
Compilation error in Excel 97 vinayrbedre Excel Programming 2 July 7th 05 09:02 AM
VBA Excel compilation error + Z + Excel Programming 1 January 15th 05 05:54 PM
Conditional Compilation using Application.Version Stephen Bullen[_4_] Excel Programming 0 November 9th 04 08:48 AM
Conditional Compilation using Application.Version Dave Peterson[_4_] Excel Programming 0 November 9th 04 01:13 AM
Conditional compilation WK Excel Programming 1 August 18th 03 01:05 AM


All times are GMT +1. The time now is 10:25 AM.

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"