Solved

Delete specific embeded object in excel 2010

Posted on 2014-03-26
2
299 Views
Last Modified: 2014-03-26
Guys

I want to be able to delete all embedded objects except a specific object on an excel spreadsheet. At the moment I have a logo at the top and my code deletes all objects including the logo and I don't want this.

can you help

the embedded object I want to keep is  "Object 34"

I use this at the moment but it deletes everything

 Wbo.Sheets("Design Request Form").OLEObjects.Delete

Regards
0
Comment
Question by:DarrenJackson
2 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 39955601
You'll need to loop - like this:

Dim oOLE as OLEObject
For each oOLE in Wbo.Sheets("Design Request Form").OLEObjects
If oOLE.Name <> "Object 34" then oOLE.Delete
Next oOLE

Open in new window

0
 

Author Closing Comment

by:DarrenJackson
ID: 39955642
great thanks for the quick response
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question