How to delete pictures from Excel spread sheet?

I'm a beginner and don't know how to do it!

Page 1 of 1

1 Replies - 12348 Views - Last Post: 02 July 2008 - 11:36 AM Rate Topic: -----

#1 salserompls  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 02-July 08

How to delete pictures from Excel spread sheet?

Posted 02 July 2008 - 11:18 AM



I need to delete all pictures from an Excel spread sheet. I know hardly any VBA. So far, I have found this code as I have been searching on the internet for help...

ActiveSheet.Shapes.SelectAll
Selection.Delete

But just putting this code in the VBA editor and creating a file to run does nothing. I just get an error that says: COMPILE ERROR: INVALID OUTSIDE PROCEDURE

Can someone please show me what other code I need to make this work? Or maybe I also need to recreate the macro in a different way. I am using the 2003 version of Excel.

Thank you!



Is This A Good Question/Topic? 0
  • +

Replies To: How to delete pictures from Excel spread sheet?

#2 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2270
  • View blog
  • Posts: 9,496
  • Joined: 29-May 08

Re: How to delete pictures from Excel spread sheet?

Posted 02 July 2008 - 11:36 AM

View Postsalserompls, on 2 Jul, 2008 - 07:18 PM, said:



I need to delete all pictures from an Excel spread sheet. I know hardly any VBA. So far, I have found this code as I have been searching on the internet for help...

ActiveSheet.Shapes.SelectAll
Selection.Delete

But just putting this code in the VBA editor and creating a file to run does nothing. I just get an error that says: COMPILE ERROR: INVALID OUTSIDE PROCEDURE

Can someone please show me what other code I need to make this work? Or maybe I also need to recreate the macro in a different way. I am using the 2003 version of Excel.

Thank you!


I'll give you the basic steps to get you started.

Tools->Customize-> Tick Control Toolbox -> Attach -> close

This will add the Control Toolbox to the collection of toolbox, within this tool box find the "Button Control".
Double Right Click on it. Go back the spreadsheet -> Press & Hold the right button & drag diagonally release the button.
Now you should have control on over the spreadsheet with "CommandButton1" on it.
Double right click on the control this will open the VBA code editor of EXCEL. Insert the code inside the subroutine and run again.

Now you can use the button.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1