XL.Book.AddPictureFile
----------------------

Adds a picture to the workbook.

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

MBS( "XL.Book.AddPictureFile"; BookRef; FilePath ) 

**MBS**( **"XL.Book.AddPictureFile";** /\* Adds a picture to the workbook. \*/  
**$BookRef**; /\* The reference number for the workbook.e.g. $ref \*/   
**$FilePath**) /\* The native file path to the image file to include.e.g. "c:\\test.jpg" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| BookRef | The reference number for the workbook. | $ref |
| FilePath | The native file path to the image file to include. | "c:\\test.jpg" |

### Result

Returns image number or error.

### Description

Adds a picture to the workbook.   
Returns a picture identifier. Supports BMP, DIB, PNG, JPG and WMF picture formats.   
Use picture identifier with [XL.Sheet.SetPictureWithScale](XLSheetSetPictureWithScale.md) or [XL.Sheet.SetPictureWithSize](XLSheetSetPictureWithSize.md) functions.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### See also

- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [XL.Book.GetPictureType](XLBookGetPictureType.md)
- [XL.Sheet.SetPictureWithScale](XLSheetSetPictureWithScale.md)
- [XL.Sheet.SetPictureWithSize](XLSheetSetPictureWithSize.md)

### Release notes

- **Version 8.2**
    - Fixed parameter count check for [XL.Book.AddPictureFile](http://www.mbsplugins.eu/XLBookAddPictureFile.shtml).

### Blog Entries

- [MBS FileMaker Plugin, version 8.2pr2](https://www.mbsplugins.de/archive/2018-04-11/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 25th October 2023

  
[XL.Book.AddPictureContainer](XLBookAddPictureContainer.md) - [XL.Book.AddSheet](XLBookAddSheet.md)

[HTML Version](XLBookAddPictureFile.shtml)