View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default moving an image in a userform

Alternatively -

Public Sub setLogo2(form As UserForm, sName As String)

form(sName).Left = 6
form(sName).Top = 6
form(sName).Width = 66
form(sName).Height = 48

End Sub

Regards,
Peter T


"Peter T" wrote in message :
In setLogo, remove the second argument "form as Userform" and "form." in
four places preceding logo.

Then simply -
setLogo UserForm1.Image1

or maybe
Dim img As MSForms.Image
Set img = UserForm1.Image1
setLogo img

or
Call setLogo(img)

Regards,
Peter T


"Gixxer_J_97" wrote in message
...
hi all!

i have a userform (userform1) and an image on the userform (image1)

i am trying to set the top, left, height and width using the following:

Public Sub setLogo(logo As Image, form As UserForm)

form.logo.Left = 6
form.logo.Top = 6
form.logo.Width = 66
form.logo.Height = 48

End Sub

but i am getting
Run-time error '438'
Object doesn't support this property or method

what am i doing wrong?

oh - and the call is

call setLogo(Image1,UserForm1)

tia

J