I have a graph in Excel that I need to move to a specific cell.
In theory, the code should be something like this:
procedure TMyExcelClass.MyProcedure; var sheet, chartObject: Variant; begin sheet := fExcel.ActiveWorkBook.Sheets['какой-то лист']; chartObject := sheet.ChartObjects[1]; chartObject.Left := <левая граница ячейки "F"> chartObject.Top := <верхняя граница ячейки "34"> end; How to position the graph to the borders of the cell? (taking into account the fact that the cells can have different width and height)
Sheet.Cells[i, j].Left. Do not work withActiveWorkbook, etc. fromApplication.ActiveXXX. ru.stackoverflow.com/a/499795/192901 - kamiApplication.Workbooks.Add. Workbooks.Application.Workbooks.Addor analogues. This is a function, and it returns a link to the book. Accordingly, we assign the result to ourmyWorkbookvariable and continue to work withmyWorkbook, and not withActiveWorkbook. By analogy - with a sheet. - kami