I’m working on a calc spreadsheet and currently have 3 tabs “Instructions”, “Raw_Data”, and “Clean_Data”. I have this code so far but it deletes all images in the entire workbook.
Sub DeleteAllPics()
Dim oDoc As Object
Dim oDrawPage As Object
Dim oShape As Object
Dim iShape As Integer
Dim iSheet As Integer
oDoc = ThisComponent
For iSheet = 1 To oDoc.getSheets().getCount() - 1
oDrawPage = oDoc.getSheets().getByIndex(iSheet).getDrawPage()
For iShape = oDrawPage.getCount() - 1 To 0 Step -1
oShape = oDrawPage.getByIndex(i)
oDrawPage.remove(oShape)
Next iShape
Next iSheet
End Sub
Any help/explanations are appreciated!!