View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gixxer_J_97[_2_] Gixxer_J_97[_2_] is offline
external usenet poster
 
Posts: 206
Default moving an image in a userform

hi Harald - thanks for the response!

- i did hit debug - and the error was
Run-time error '438'
Object doesn't support this property or method


on the line
form.logo.Left = 6


the image is not autosized

the call to setLogo() is in the userform UserForm1 (in UserForm_Initialize)

the code itself is in a module (same project)

and as far as why i need it, i don't really but - it's a pain in the a$$ to
have to set the loc and width of this 40 or 50 times as i'm creating the
userform pages. find it much easier just to plunk it close to where i want
it, create the rest of the stuff and then have it force it into position.
could be wrong - but that's just me =)

in all honesty - all i have is a userform, with an image - and
UserForm_Initialize()
with that call inside.


"Harald Staff" wrote:

Hi J

If you click "debug" instead of "end" then you might be shown the error. Or
maybe not, if the macros are nested too deep then no luck, it says
"userform1.show" instead.

I can't test it properly without more detail. But two things from reading
it: Width and height may not make sense if you autosize the image. And
"Image1" may or may not make sense, depending on where this code is. Try
call setLogo(UserForm1.Image1,UserForm1)
call setLogo(Me.Image1,UserForm1)

(But why do you need a macro for that operation at all, it seems pretty
fixed ?)

HTH. Best wishes Harald

"Gixxer_J_97" skrev i melding
...
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