How can I do that?
CellAddress is a read only property.
Code: Select all
Sub Main
MovePic("Image 1", "Sheet1", "Sheet2")
End sub
Sub MovePic(sName, sOldPlace, sNewPlace)
oDoc = ThisComponent
oSheetO = oDoc.Sheets.getByName(sOldPlace)
oSheetD = oDoc.Sheets.getByName(sNewPlace)
oPageO = oSheetO.getDrawPage
oPageD = oSheetD.getDrawPage
for i = 0 to oPageO.Count - 1
oImage = oPageO.getByIndex(i)
if oImage.Name = sName then exit for
next
oAddress = oImage.Anchor.getCellAddress()
'??? not possible to just change oAddress.Sheet ???
End sub