XL.Sheet.SetPictureWithScale
----------------------------

Sets a picture with pictureId identifier at position row and col with scale factor and offsets in pixels.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [XL](component_XL.md) | [3.5](newinversion35.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "XL.Sheet.SetPictureWithScale"; BookRef; SheetIndex; Row; Column; pictureId; Scale { ; X; Y; Pos } ) 

**MBS**( **"XL.Sheet.SetPictureWithScale";** /\* Sets a picture with pictureId identifier at position row and col with scale factor and offsets in pixels. \*/  
**$BookRef**; /\* The reference number for the workbook.e.g. $ref \*/   
**$SheetIndex**; /\* The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1.e.g. 0 \*/   
**$Row**; /\* The row for the cell. First row has index 0. \*/   
**$Column**; /\* The column for the cell. First column has index 0. \*/   
**$pictureId**; /\* The picture identifier number. \*/   
**$Scale**; /\* The scale factor.e.g. 1.0 \*/   
**$X**; /\* Optional; Relative offset.e.g. 0 \*/   
**$Y**; /\* Optional; Relative offset.e.g. 0 \*/   
**$Pos**) /\* Optional; The positioning. 0 = Move and Size, 1 = Move, 2 = Absolute.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| BookRef | The reference number for the workbook. | $ref |  |
| SheetIndex | The index of the sheet. This number ranges from 0 to [XL.Book.SheetCount](XLBookSheetCount.md)-1. | 0 |  |
| Row | The row for the cell. First row has index 0. | $row |  |
| Column | The column for the cell. First column has index 0. | $column |  |
| pictureId | The picture identifier number. | $pictureID |  |
| Scale | The scale factor. | 1.0 |  |
| X | Relative offset. | 0 | Optional |
| Y | Relative offset. | 0 | Optional |
| Pos | The positioning. 0 = Move and Size, 1 = Move, 2 = Absolute. | 0 | Optional |

### Result

Returns OK or error.

### Description

Sets a picture with pictureId identifier at position row and col with scale factor and offsets in pixels.  
Use [XL.Book.AddPictureFile](XLBookAddPictureFile.md) or [XL.Book.AddPictureContainer](XLBookAddPictureContainer.md) for getting picture identifier.  
  
scale = 0 means the picture is stretched inside the specified cell or merged area.  
### Examples

Add a picture to excel sheet:

 # add picture to file   
Set Variable \[$logoID ; Value:MBS ( "[XL.Book.AddPictureContainer](XLBookAddPictureContainer.md)"; $book ; Writing data::Logo )\]  
\# position with size:   
Set Variable \[$r ; Value:MBS ( "[XL.Sheet.SetPictureWithSize](XLSheetSetPictureWithSize.md)"; $book ; $sheet ; 2; 1; $logoID ; 100; 100)\]  
\# or with factor:   
Set Variable \[$r ; Value:MBS ( "XL.Sheet.SetPictureWithScale"; $book ; $sheet ; 2; 1; $logoID ; .2)\]  
### See also

- [XL.Book.AddPictureContainer](XLBookAddPictureContainer.md)
- [XL.Book.AddPictureFile](XLBookAddPictureFile.md)
- [XL.Book.SheetCount](XLBookSheetCount.md)
- [XL.Sheet.SetPictureWithSize](XLSheetSetPictureWithSize.md)

### Example Databases

- [XL/Writing data](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Writing%20data.shtml#5ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 6th June 2024

  
[XL.Sheet.SetPaper](XLSheetSetPaper.md) - [XL.Sheet.SetPictureWithSize](XLSheetSetPictureWithSize.md)

[HTML Version](XLSheetSetPictureWithScale.shtml)