tags:

views:

16

answers:

1

Hello please help on the following, I'm parameterizing a Excel chart via OLE. The back ground picture is set

Sheets.Item['Chart1'].SetBackgroundPicture("ThePicture.jpg")

This works however I want to change the Picturetype to stretched. How? Thanks

A: 

Try using the UserPicture method instead: seems to work (Excel 2003, not tested in other versions).

From Excel VBA Help

UserPicture Method See AlsoApplies ToExampleSpecificsUserPicture method as it applies to the FillFormat object.

Fills the specified shape with an image.

expression.UserPicture(PictureFile) expression Required. An expression that returns one of the above objects.

PictureFile Required String. The name of the picture file.

UserPicture method as it applies to the ChartFillFormat object.

Fills the specified shape with an image.

expression.UserPicture(PictureFile, PictureFormat, PictureStackUnit, PicturePlacement) expression Required. An expression that returns one of the above objects.

PictureFile Optional Variant.

PictureFormat Required XlChartPictureType. XlChartPictureType can be one of these XlChartPictureType constants. xlStack xlStackScale xlStretch

XlChartPictureType can be one of these XlChartPictureType constants. xlStack xlStackScale xlStretch

PictureStackUnit Required Long. The picture stack or scale unit (depends on the PictureFormat argument).

PicturePlacement Required XlChartPicturePlacement.

XlChartPicturePlacement can be one of these XlChartPicturePlacement constants. xlAllFaces xlEnd xlEndSides

xlFront

xlFrontEnd

xlFrontSides

xlSides

Example This example sets the fill format for chart two.

Charts(2).ChartArea.Fill.UserPicture "brick.gif"

Charles Williams
Hello Mr Williams this works! First I had to make the fill visible, Sheets.Item['Chart1'].ChartArea.Fill.Visible = True Thank you very much
addelichtman