Добрый день, можно попробовать воспользоваться буфером обмена.
Не знаю кто писал, у нас есть такой метод в классе ComExcelDocument_RU
Не знаю как под 12ку, но думаю что-то подобное можно адаптировать.
вызывается так
X++:
excel.insertImage('companyLogo', companyImage.Image, false, 230);
соответственно когда генерите QR Code он должен быть в форме Bitmap.
X++:
public void insertImage(
MSOfficeBookMark_RU _bookMark,
Bitmap _bitmap,
boolean _transparent = false,
int _incrementLeft = 0,
int _incrementTop = 0,
int _workSheet = 1)
{
COM XLSWorkSheet, XLSrange;
Image image;
COM comApplication, shape, pf;
;
if (!_bitmap)
return;
XLSWorkSheet = this.getWorkSheet(_workSheet);
if (!XLSWorkSheet)
throw error("@DIS6043");
XLSrange = this.findRange(_bookMark);
if (!XLSrange)
throw error("@SYS27391");
XLSrange.select();
image = new Image();
image.setData(_bitmap);
image.clipboardCopy();
XLSWorkSheet.pasteSpecial(0);
comApplication = m_comDocument.application();
shape = comApplication.Selection();
shape = shape.ShapeRange();
if (_incrementLeft)
shape.IncrementLeft(_incrementLeft);
if (_incrementTop)
shape.IncrementTop(_incrementTop);
if (_transparent)
{
pf = shape.PictureFormat();
pf.TransparentBackground(-1);
pf.TransparencyColor(WinAPI::RGB2int(255,255,255));
}
}