View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Cell data to a userform object

That said, if Sheets("Sheet1").Cells(counter,2).Value contained the string
C:\WINNT\Coffee Bean.bmp

as an example, it worked fine for me as written

Private Sub UserForm_Initialize()
counter = 2
UserForm1.Image1.Picture = LoadPicture("C:\Winnt\Coffee Bean.bmp")
UserForm1.Label1.Picture = LoadPicture(Sheets(1).Cells(counter, 2).Value)
End Sub


Note that the image looked better in the image control.

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
LoadPicture only works with picture files.

--
Regards,
Tom Ogilvy


"Syrous" wrote in message
...
Hey everyone!

I'm trying to take the information from a cell which contains a file

location and then using that location change the property of an object in
one of my userforms. The code I'm showing is the idea of what I want to

do
but it's not right.

UserForm4.Label4.Picture = LoadPicture (Sheets("Sheet1").Cells(counter,

2).value)

If someone has a solution that'd be great. Thanks.