View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mooresk257 mooresk257 is offline
external usenet poster
 
Posts: 50
Default Change Imagebox Property?

I posted the code earlier on a different topic:

Private Sub Image1_Click()

FileToOpen = Application.GetOpenFilename( _
"All Files (*.jpg),*.jpg,(*.bmp),*.bmp")
If FileToOpen < False Then
Worksheets("Sheet1").OLEObjects("Image1").Object.P icture _
= LoadPicture(FileToOpen)
End If

End Sub

If I want to remove the image, I have to change the image box Picture
property to "none". Can anyone help with the code for setting properties?

I think I'd need something like

Worksheets("Sheet1").OLEObjects("Image1").Object.P icture _
= None

Is it possible to assign this to a right-click event? Or, maybe I should add
some code for a message box prompting to add or remove an image. I'm not sure
what the simplest solution is.

I'm so rusty on VB code - it's been years since I messed with it.

Thanks folks!