Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
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 | 3.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
bookRef | The reference to the workbook. Please use XL.LoadBook to load a file. | $ref | |
sheetIndex | The index of the sheet. This number ranges from 0 to XL.Book.SheetCount-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 |
Returns OK or error.
Add a picture to excel sheet:
# add picture to file
Set Variable [$logoID; Value:MBS( "XL.Book.AddPictureContainer"; $book; Writing data::Logo)]
# position with size:
Set Variable [$r; Value:MBS( "XL.Sheet.SetPictureWithSize"; $book; $sheet; 2; 1; $logoID; 100; 100)]
# or with factor:
Set Variable [$r; Value:MBS( "XL.Sheet.SetPictureWithScale"; $book; $sheet; 2; 1; $logoID; .2)]
This function checks for a license.
Created 18th August 2014, last changed 27th July 2018