ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I programatically identify and delete an image? (https://www.excelbanter.com/excel-programming/323779-how-can-i-programatically-identify-delete-image.html)

Henry Stock

How can I programatically identify and delete an image?
 
I am working on a bunch of macros that manuipulate data from accounting for
input into a database.

Some of the worksheets I get tend to have a logo attached to the data sheet.
The logo just makes it hard to see the real data I want to work with.

I would like to identify a way I could detect the existence of an image and
then programatically remove it so that my other data minipulation won't
have to deal with it. Can somebody tell me how to do that?

--
Henry Stock, IT Professional
onProject.com
3 Wing Drive
Cedar Knolls, NJ 07927-1006



Jim Thomlinson[_3_]

How can I programatically identify and delete an image?
 
You can make a copy of the sheet without the picures. This code might work
for you...

Sub CopyWithoutImages()
Dim wksNew As Worksheet
Dim wks As Worksheet

For Each wks In Worksheets
wks.Cells.Copy
Set wksNew = Sheets.Add
wksNew.Range("A1").PasteSpecial xlValues
'Do that voodoo that you do
wksNew.Delete
Next wks
Application.CutCopyMode = False
End Sub

This pastes only the values from the original sheet to the new sheet. The
new sheet is deleted after you finish your database stuff... If you want to
you could place the new sheets in a different workbook and not delete them.

HTH

"Henry Stock" wrote:

I am working on a bunch of macros that manuipulate data from accounting for
input into a database.

Some of the worksheets I get tend to have a logo attached to the data sheet.
The logo just makes it hard to see the real data I want to work with.

I would like to identify a way I could detect the existence of an image and
then programatically remove it so that my other data minipulation won't
have to deal with it. Can somebody tell me how to do that?

--
Henry Stock, IT Professional
onProject.com
3 Wing Drive
Cedar Knolls, NJ 07927-1006




galimi[_2_]

How can I programatically identify and delete an image?
 
Henry,

The following code will identify all Shapes and delete them

for each sht in activeworkbook.sheets
for each shp in sht.shapes

shp.delete

next
next

http://HelpExcel.com
"Henry Stock" wrote:

I am working on a bunch of macros that manuipulate data from accounting for
input into a database.

Some of the worksheets I get tend to have a logo attached to the data sheet.
The logo just makes it hard to see the real data I want to work with.

I would like to identify a way I could detect the existence of an image and
then programatically remove it so that my other data minipulation won't
have to deal with it. Can somebody tell me how to do that?

--
Henry Stock, IT Professional
onProject.com
3 Wing Drive
Cedar Knolls, NJ 07927-1006





All times are GMT +1. The time now is 11:55 AM.

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