Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
moving an image in a userform
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
moving an image in a userform
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
moving an image in a userform
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
moving an image in a userform
hmmm
i got it to work by changing call setLogo(me.image1) and obviously adjusting the sub to accept only 1 arg and each line i removed the form. . thanks guys J "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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check image availability on userform | Excel Programming | |||
UserForm as a Jpeg Image | Excel Programming | |||
Bmp vs Gif in Userform image controls | Excel Programming | |||
Userform - dispaly graph as image | Excel Programming | |||
Userform Image help | Excel Programming |