AlexMason
03-19-2010, 03:50 AM
Hey guys a friend of mine is trying to do something excel using userForms.
the premise is this:
UserForm1 comes up and its got sliders, some buttons and a picture box. you use the sliders to set some numbers, press plot, a graph is generated and a gif image of that is loaded to the picture box. this image is stored in a pre-determined location on D:\
if you press save plot, UserForm2 then pops up. ideally UserForm2 will pop up and load the same image into another picture box.
however, UserForm2 is popping up then doing nothing. it gives the error
Runtime Error 424 : Object Required when trying to load the picture.
heres the code when you press the save plot command button
Private Sub CommandButton3_Click()
Load UserForm2
UserForm1.Hide
UserForm2.Show
UserForm2image.Picture = LoadPicture("D:\Data\energy gen\transfer\Mychart.gif")
End Sub
it gets stuck on that last line, a line that works perfectly fine for UserForm1. is it a case of unloading from one and loading to the other?
the premise is this:
UserForm1 comes up and its got sliders, some buttons and a picture box. you use the sliders to set some numbers, press plot, a graph is generated and a gif image of that is loaded to the picture box. this image is stored in a pre-determined location on D:\
if you press save plot, UserForm2 then pops up. ideally UserForm2 will pop up and load the same image into another picture box.
however, UserForm2 is popping up then doing nothing. it gives the error
Runtime Error 424 : Object Required when trying to load the picture.
heres the code when you press the save plot command button
Private Sub CommandButton3_Click()
Load UserForm2
UserForm1.Hide
UserForm2.Show
UserForm2image.Picture = LoadPicture("D:\Data\energy gen\transfer\Mychart.gif")
End Sub
it gets stuck on that last line, a line that works perfectly fine for UserForm1. is it a case of unloading from one and loading to the other?