Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 44
Default Problems with xl97 & xl2K

Hi

I have a version problem. The following script creates an icon on the
toolbar. The problem is, that Excel 97 and Excel 2000 cannot handle the
..Picture property.

Private Sub SetIcon(cbrCtrl As CommandBarButton, shpPict As Shape, shpMask
As Shape)
Dim oMask As StdPicture

If Val(Application.Version) <= 9 Then
shpPict.Copy
cbrCtrl.PasteFace
Else
shpMask.CopyPicture xlScreen, xlBitmap
cbrCtrl.PasteFace
Set oMask = cbrCtrl.Picture
shpPict.CopyPicture xlScreen, xlBitmap
cbrCtrl.PasteFace
cbrCtrl.Mask = oMask
End If

Application.CutCopyMode = False

End Sub

How to program this code without a compile error?

Tom


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problems with xl97 & xl2K

put the code in the second leg of the if statement in a separate sub and
don't comile. Call the sub if the version so dictates.

--
Regards,
Tom Ogilvy

"Tom" wrote in message
...
Hi

I have a version problem. The following script creates an icon on the
toolbar. The problem is, that Excel 97 and Excel 2000 cannot handle the
.Picture property.

Private Sub SetIcon(cbrCtrl As CommandBarButton, shpPict As Shape, shpMask
As Shape)
Dim oMask As StdPicture

If Val(Application.Version) <= 9 Then
shpPict.Copy
cbrCtrl.PasteFace
Else
shpMask.CopyPicture xlScreen, xlBitmap
cbrCtrl.PasteFace
Set oMask = cbrCtrl.Picture
shpPict.CopyPicture xlScreen, xlBitmap
cbrCtrl.PasteFace
cbrCtrl.Mask = oMask
End If

Application.CutCopyMode = False

End Sub

How to program this code without a compile error?

Tom




  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 44
Default Problems with xl97 & xl2K

Is it not possible to use something like that:

#If VB6 Then
....

or

#If ccXL2K Then
....


Tom



"Tom Ogilvy" schrieb im Newsbeitrag
...
put the code in the second leg of the if statement in a separate sub and
don't comile. Call the sub if the version so dictates.

--
Regards,
Tom Ogilvy

"Tom" wrote in message
...
Hi

I have a version problem. The following script creates an icon on the
toolbar. The problem is, that Excel 97 and Excel 2000 cannot handle the
.Picture property.

Private Sub SetIcon(cbrCtrl As CommandBarButton, shpPict As Shape,

shpMask
As Shape)
Dim oMask As StdPicture

If Val(Application.Version) <= 9 Then
shpPict.Copy
cbrCtrl.PasteFace
Else
shpMask.CopyPicture xlScreen, xlBitmap
cbrCtrl.PasteFace
Set oMask = cbrCtrl.Picture
shpPict.CopyPicture xlScreen, xlBitmap
cbrCtrl.PasteFace
cbrCtrl.Mask = oMask
End If

Application.CutCopyMode = False

End Sub

How to program this code without a compile error?

Tom






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Problems with xl97 & xl2K

No it isn't. xl2000 and greater would evaluate to True for #if VBA6

Unless you want to manually alter your code to define your own constant,
there is no predefined constant that will identify xl2000 from xl2002 (or
xl2003).

You can separate xl97 from xl2000 and later that way, but not xl97 and
xl2000 separate from xl2002 and later.

--
Regards,
Tom Ogilvy

"Tom" wrote in message
...
Is it not possible to use something like that:

#If VB6 Then
...

or

#If ccXL2K Then
...


Tom



"Tom Ogilvy" schrieb im Newsbeitrag
...
put the code in the second leg of the if statement in a separate sub and
don't comile. Call the sub if the version so dictates.

--
Regards,
Tom Ogilvy

"Tom" wrote in message
...
Hi

I have a version problem. The following script creates an icon on the
toolbar. The problem is, that Excel 97 and Excel 2000 cannot handle

the
.Picture property.

Private Sub SetIcon(cbrCtrl As CommandBarButton, shpPict As Shape,

shpMask
As Shape)
Dim oMask As StdPicture

If Val(Application.Version) <= 9 Then
shpPict.Copy
cbrCtrl.PasteFace
Else
shpMask.CopyPicture xlScreen, xlBitmap
cbrCtrl.PasteFace
Set oMask = cbrCtrl.Picture
shpPict.CopyPicture xlScreen, xlBitmap
cbrCtrl.PasteFace
cbrCtrl.Mask = oMask
End If

Application.CutCopyMode = False

End Sub

How to program this code without a compile error?

Tom








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
Change Autosave defaults in XL2k RWN Setting up and Configuration of Excel 3 October 20th 05 03:16 AM
Does XL2K have hard hyphens? StargateFan Excel Discussion (Misc queries) 5 February 19th 05 07:52 PM
Copying autoshapes - XL2K Ildhund Excel Discussion (Misc queries) 2 February 17th 05 02:44 AM
Paste columnwidths in Xl2k problem Stuart[_5_] Excel Programming 3 September 4th 03 05:09 PM
Open XL2K without executing Macros Sean[_5_] Excel Programming 1 August 15th 03 01:00 PM


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

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

About Us

"It's about Microsoft Excel"