Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Loading images

I'm loading pictures into Image1, Image2, Image3 on a
useform called "Game". Here's what I have:

For i = 1 To 3
Game.Image & i.Picture = LoadPicture("C:\....")
Next i

The "Image & i" is erroring. What's the correct syntax?
Thx.
Jason
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Loading images

Hi Jason,

You can't concatenate object names like that. You'll have to do it with
three separate lines of code (or do something more complex, like set the Tag
properties of each image control, then loop the whole controls collection
and identify them by their Tag).

Game.Image1.Picture = LoadPicture("C:\....")
Game.Image2.Picture = LoadPicture("C:\....")
Game.Image3.Picture = LoadPicture("C:\....")

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"Jason Morin" wrote in message
...
I'm loading pictures into Image1, Image2, Image3 on a
useform called "Game". Here's what I have:

For i = 1 To 3
Game.Image & i.Picture = LoadPicture("C:\....")
Next i

The "Image & i" is erroring. What's the correct syntax?
Thx.
Jason



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Loading images

Jason,

Try this:

Game.Controls("Image" & i).Picture = LoadPicture("C:\....")

hth,

Doug Glancy

"Jason Morin" wrote in message
...
I'm loading pictures into Image1, Image2, Image3 on a
useform called "Game". Here's what I have:

For i = 1 To 3
Game.Image & i.Picture = LoadPicture("C:\....")
Next i

The "Image & i" is erroring. What's the correct syntax?
Thx.
Jason



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Loading images

What I do is this:

For i = 1 to 3
Game.Controls("Image" & i).Object.Picture = LoadPicture("C:\...")
Next i

--
Regards,

Juan Pablo González

"Jason Morin" wrote in message
...
I'm loading pictures into Image1, Image2, Image3 on a
useform called "Game". Here's what I have:

For i = 1 To 3
Game.Image & i.Picture = LoadPicture("C:\....")
Next i

The "Image & i" is erroring. What's the correct syntax?
Thx.
Jason



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Loading images

Thanks! That did the trick.

-----Original Message-----
Jason,

Try this:

Game.Controls("Image" & i).Picture = LoadPicture

("C:\....")

hth,

Doug Glancy

"Jason Morin" wrote

in message
...
I'm loading pictures into Image1, Image2, Image3 on a
useform called "Game". Here's what I have:

For i = 1 To 3
Game.Image & i.Picture = LoadPicture("C:\....")
Next i

The "Image & i" is erroring. What's the correct syntax?
Thx.
Jason



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Loading images

Gracias. Ahora funciona perfectamente.

-----Original Message-----
What I do is this:

For i = 1 to 3
Game.Controls("Image" & i).Object.Picture =

LoadPicture("C:\...")
Next i

--
Regards,

Juan Pablo González

"Jason Morin" wrote

in message
...
I'm loading pictures into Image1, Image2, Image3 on a
useform called "Game". Here's what I have:

For i = 1 To 3
Game.Image & i.Picture = LoadPicture("C:\....")
Next i

The "Image & i" is erroring. What's the correct syntax?
Thx.
Jason



.

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
loading add ins [email protected] Excel Discussion (Misc queries) 0 October 30th 08 02:51 PM
Chart.Export images are shrinking as I export more images Jared Charts and Charting in Excel 3 January 29th 08 03:23 AM
Loading... K Excel Discussion (Misc queries) 1 October 7th 07 09:37 PM
loading mallahd Excel Discussion (Misc queries) 2 May 25th 07 07:59 PM
Add-ins not loading John F Excel Discussion (Misc queries) 2 February 17th 05 08:54 PM


All times are GMT +1. The time now is 08:37 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"