Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell data to a userform object
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell data to a userform object
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cell data to a userform object
Hate to say it, but it works fine for me. What do you have in the variable
counter? What error do you get? -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Vba add data to cell from userform | Excel Programming | |||
VB6 to VBA conversion. Form vs. UserForm differences. Object variable types | Excel Programming | |||
Argh...layering object problem in userform | Excel Programming | |||
Using Userform object in Excel via automation from VB 6 | Excel Programming | |||
unable to create embedded object on a userform | Excel Programming |