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 |
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 |
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