ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delete images in an excel sheet (https://www.excelbanter.com/excel-programming/364278-delete-images-excel-sheet.html)

[email protected]

delete images in an excel sheet
 
Hi

My Macros retrieves graphs from an external app as jpg images and
pastes them in the sheet.

before i run this macro i want to delete these old images. i tried this
but it is not an oleobject. how are images treated as in excel

For Each obj In Sheet1.OLEObjects

obj.Delete

Next oCheck


Ron de Bruin

delete images in an excel sheet
 
See
http://www.rondebruin.nl/controlsobjectsworksheet.htm

For example

Sub Shapes1()
'Delete all Objects except Comments
On Error Resume Next
ActiveSheet.DrawingObjects.Visible = True
ActiveSheet.DrawingObjects.Delete
On Error GoTo 0
End Sub


--
Regards Ron De Bruin
http://www.rondebruin.nl



wrote in message oups.com...
Hi

My Macros retrieves graphs from an external app as jpg images and
pastes them in the sheet.

before i run this macro i want to delete these old images. i tried this
but it is not an oleobject. how are images treated as in excel

For Each obj In Sheet1.OLEObjects

obj.Delete

Next oCheck




AA2e72E

delete images in an excel sheet
 


" wrote:

... before i run this macro i want to delete these old images. i tried this but it is not an oleobject. how are images treated as in excel


Try:

For Each pic In Sheet1.Shapes
pic.Delete
Next




All times are GMT +1. The time now is 04:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com