View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Picture in UserForm

What picture format are you using? I don't think that you can use PNG
files. GIF and JPG work fine. E.g.,

Drag an Image control on to your form and then use code like

Private Sub CommandButton1_Click()
Dim FileName As String
Dim Pict As stdole.StdPicture
FileName = "C:\CPearsonWeb\Images\alerter1.jpg"
Set Pict = New stdole.StdPicture
Set Pict = LoadPicture(FileName)
UserForm1.Image1.Picture = Pict
End Sub

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Thu, 18 Dec 2008 16:34:00 -0800, Howard31
wrote:

Hi All,

I'm having trouble getting a picture into a picture control in a userform.
Every time I select a picture file for the control I get a error message,
something like 'Picture file is not valid'