简体   繁体   中英

Remove image from ActiveX Image Control - VBA

I have created a macro enabled Excel Spreadsheet that will programmatically load a image from disk and load it into an ActiveX image control.

How to I remove the image? I want to remove the image from my testing the process. I do not need to create a script to programmatically remove it.

To clear out the picture manually:

  1. Open the Visual Basics Editor and make sure you can View both the Project Explorer and the Properties Window.
  2. In the Project Explorer select the Excel object or form the image control is on. (If it is a user form, you will need to double-click.)
  3. The selected object should now be listed in the Properties Window. Click the drop-down box and select your image control.
  4. Double-click the value for the Picture property so you have a blinking cursor.
  5. Press Delete.

To remove the image manually, go into Design mode (View > Toolbars > Control Toolbox and click the "Design Mode" button). Right-click the control and choose "Properties". Click in the "Picture" property and backspace or delete until it says (None) .

This assumes that the image is loaded into an Image Control on the worksheet and not on a VBA userform. You could follow mischab1's instructions if the control was on a VBA userform OR an image control.

And of course these instructions are for Excel 2003; the specific steps vary depending on Excel version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM