Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vba add data to cell from userform adrian Excel Programming 4 May 27th 04 08:02 AM
VB6 to VBA conversion. Form vs. UserForm differences. Object variable types Rick Labs Excel Programming 2 May 4th 04 11:36 PM
Argh...layering object problem in userform jasonsweeney[_70_] Excel Programming 2 April 21st 04 07:22 PM
Using Userform object in Excel via automation from VB 6 Howard Kaikow Excel Programming 10 December 5th 03 02:58 PM
unable to create embedded object on a userform Robert Nobles Excel Programming 0 September 9th 03 08:49 PM


All times are GMT +1. The time now is 03:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"