Solved

Delete specific embeded object in excel 2010

Posted on 2014-03-26
2
295 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
My experience with Windows 10 over a one year period and suggestions for smooth operation
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now