?
Solved

Delete specific embeded object in excel 2010

Posted on 2014-03-26
2
Medium Priority
?
305 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

This article describes a serious pitfall that can happen when deleting shapes using VBA.
Gain an elementary understanding of Blockchain technology.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

752 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