VBA CopyPicture format issue

Webster

New Member
Joined
Dec 23, 2008
Messages
3
When using CopyPicture in Excel with Format = xlPicture and Appearance = xlScreen, if I examine the clipboard, the following Formats are present:
xlClipboardFormatPICT (Value = 2); xlClipboardFormatLink (Value = 11).
This is the same whether I do the copy manually through the UI or use VBA.

When I use Format = xlBitmap manually, the Clipboard contains formats:
xlClipboardFormatBitmap (Value = 9); xlClipboardFormatLink (Value = 11)
Plus an unknown format with a value of 45

However, when using VBA with a format of xlBitmap, the clipboard contains the format values of 2 and 11 - The same as when Format =xlPicture. I would expect the clipboard to contain the same formats whether the CopyPicture was initiated manually or through VBA.

Is this expected behavior, a bug or some configuration setting? I'd be interested to know if anyone else can reproduce this.

Does anyone know what XlClipboardFormat value of 45 is?

Using Excel 2007 and Windows Vista. VBA version 6.5.1024

Here's the simplified code:
Sub Macro1()
fmta = Application.ClipboardFormats

Range("BA53:BF61").Select
Selection.CopyPicture Appearance:=xlScreen, Format:=xlBitmap

' Use Watch window to examine the Clipboard formats-FmtA
End Sub

Regards
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,399
Latest member
alchavar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top