Excel 2007/Vista - PastePicture Problem
Nice one Peter.
Yes I can confirm that my results are the same as yours. Which means I
can simply my code to the following and it works in both versions of
Excel...
(again beware of wrap-around)
Public Sub CreateStatusKeyBitmaps()
Dim i As Long
Dim oPic As IPictureDisp
For i = 0 To 5
wksParams.Range("Status" & i).Copy
Set oPic = PastePicture(xlBitmap)
SavePicture oPic, Environ("TEMP") & "\Status" & i & ".bmp"
Next i
End Sub
....however I won't be doing that. To muddy the waters still further,
here's why...
When I drew my coloured rectangle shapes I added a gradient fill which
gave them a cool 3D look that made a marked improvement to the look of
the menu items in XL2007. Incidentally I placed them precisely over
the original ranges that I'd been copying, in the hope that the 2003
'Range.CopyPicture' would see them - and it does!
Cue the new 'Range.Copy' code and that sees the natty new shapes too -
but only in XL2003. ?:^(
Using 'Range.Copy' in XL2007 gives the plain old flat colour of the
range beneath.
None-the-less, I am pleased with the current results from my 'dual-
version' code so thank you very much for your help Peter and I hope
others benefit too.
Br, Nick H
|