Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default conditional compile for LoadPicture?

Have some code that takes a .bmp file and puts the image on a popup menu
item.
This uses LoadPicture and
CommandBarButton.Picture

I thought that this would work in all version of Excel 2000, but it doesn't
compile
in this version: Excel 2000 9.0.3821 SR-1

Now would it be possible to use conditional compilation so it will compile
in
2002 and 2003, but not in 2000?
I would then just use a FaceID for 2000.

I had a good search for this, but couldn't find any clear guidance and my
impression is
that this can't be done. The trouble is I need to differentiate 2000 and
above 2000.
I understand 97 and above 97 would be less trouble as there is the VBA6
constant.

Thanks for any advice on this.

RBS

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default conditional compile for LoadPicture?

the only compile constant differentiates VBA6 from VBA5 (xl97 from later
versions).

The usual recomendation is to put it in a separate procedure and which is
called based on the version number. Then don't compile the code and if the
function is never accessed, it will never get compiled.

--
Regards.
Tom Ogilvy


"RB Smissaert" wrote:

Have some code that takes a .bmp file and puts the image on a popup menu
item.
This uses LoadPicture and
CommandBarButton.Picture

I thought that this would work in all version of Excel 2000, but it doesn't
compile
in this version: Excel 2000 9.0.3821 SR-1

Now would it be possible to use conditional compilation so it will compile
in
2002 and 2003, but not in 2000?
I would then just use a FaceID for 2000.

I had a good search for this, but couldn't find any clear guidance and my
impression is
that this can't be done. The trouble is I need to differentiate 2000 and
above 2000.
I understand 97 and above 97 would be less trouble as there is the VBA6
constant.

Thanks for any advice on this.

RBS


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default conditional compile for LoadPicture?

Thanks, will try that, although it is not great not being able to
compile.
I suppose I could temporarily comment out those bits, compile and then
put
them back.
Maybe not worth the trouble and better stick with a simple FaceID.

RBS



Tom Ogilvy wrote:
the only compile constant differentiates VBA6 from VBA5 (xl97 from later
versions).

The usual recomendation is to put it in a separate procedure and which is
called based on the version number. Then don't compile the code and if the
function is never accessed, it will never get compiled.

--
Regards.
Tom Ogilvy


"RB Smissaert" wrote:

Have some code that takes a .bmp file and puts the image on a popup menu
item.
This uses LoadPicture and
CommandBarButton.Picture

I thought that this would work in all version of Excel 2000, but it doesn't
compile
in this version: Excel 2000 9.0.3821 SR-1

Now would it be possible to use conditional compilation so it will compile
in
2002 and 2003, but not in 2000?
I would then just use a FaceID for 2000.

I had a good search for this, but couldn't find any clear guidance and my
impression is
that this can't be done. The trouble is I need to differentiate 2000 and
above 2000.
I understand 97 and above 97 would be less trouble as there is the VBA6
constant.

Thanks for any advice on this.

RBS



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
compile Duplatt New Users to Excel 5 March 26th 09 01:51 AM
Won't Compile GeorgeJ Excel Discussion (Misc queries) 3 July 30th 07 09:22 PM
VBAProject name compile error, not defined at compile time Matthew Dodds Excel Programming 1 December 13th 05 07:17 PM
LoadPicture - how to keep .jpg compression No Name Excel Programming 0 May 25th 04 08:14 AM
LoadPicture Pathname or no Pathname Philipp Schramek Excel Programming 1 July 8th 03 03:30 PM


All times are GMT +1. The time now is 07:46 AM.

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"