Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default changing pictures according to cell value


hi guys

I've a sheet with vba code and many pictures the code's function is to
display the picture which i write its name in cell (A1)
it works well
the problem that the code stop to work after adding number of pictures
that makes me conclude that excel has limit number of picture or
pictures size or there is aproblem
so i hope to find any one who can expaline this form me or solve the
problem


Code:
--------------------
Option Explicit

Private Sub Worksheet_Calculate()
Dim sora As Picture
Me.Pictures.Visible = False
With Range("d8")
For Each sora In Me.Pictures
If sora.Name = .Text Then
sora.Visible = True
sora.Top = .Top
sora.Left = .Left
Exit For
End If
Next sora
End With
End Sub
--------------------


i hope to know the reason of the error


--
frsm
------------------------------------------------------------------------
frsm's Profile: http://www.excelforum.com/member.php...o&userid=31231
View this thread: http://www.excelforum.com/showthread...hreadid=557600

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default changing pictures according to cell value

Hi,

I tried out your code and it at first didn't work. Then I realised that
I needed to have the formula =A1 in D8. Before doing that the Calculate
Event was not being triggered when pressing Enter after typing a
Picture's name into D8. So now it works well when I type a Picture's
name into A1.

I don't know of any limit to the number of pictures. How many pictures
are you using on the sheet?

Also, you haven't mentioned any error messages, so it's simply stopped
working.

It might be that the Calculate Event is not being triggered. To check
that just add the line...

MsgBox ""

to the code.

If the code is being triggered the message box with an OK button will
appear (provided you didn't place the MsgBox "" line inside a
conditional statement such as If)

Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default changing pictures according to cell value


hi ken ,
thank you for repalying
yes u did right , u can write the word in d8 or make a1=d8
i need to insert more than 1500 pictures ,
the error massage apears after adding 50 pictures nearly
here is the error message :-


Code:
--------------------
(run-time error '1004':
unable to set the visible property of the picture class
--------------------
and in the visual basic window it colores the following sentance with
yallow

Code:
--------------------
Me.Pictures.Visible = True
--------------------


i am going to the reason is the number of the pictures but may be the
reason is different ,so iam waiting to ur suggistions and hope to solve
this issue

with my best wishes


--
frsm
------------------------------------------------------------------------
frsm's Profile: http://www.excelforum.com/member.php...o&userid=31231
View this thread: http://www.excelforum.com/showthread...hreadid=557600

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default changing pictures according to cell value

Hi frsm,

I've tried, but haven't managed to cause that error.

I can't help feeling the problem is somehow caused by one of your
pictures.

If you are able to email me a copy of the failing workbook I can have a
close look and might be able to find the cause. I too would like to see
the problem solved.

Ken Johnson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default changing pictures according to cell value


hi ken ,
i want to thank you for ur replay
i dnt exact if the reason of the error related to the amount of the
pictures or any other reasons .
now u opened anew window that make me examin the pictures type ,maybe
there an error in the type of one of the pictures ?!inspite of when i
add anew picuter it stop working but if i delete any picture and insert
anew one it works well that makes me say thr nuber of the pictures is
the reason

dear ken plz send me ur email to send u a file if it is possible


--
frsm
------------------------------------------------------------------------
frsm's Profile: http://www.excelforum.com/member.php...o&userid=31231
View this thread: http://www.excelforum.com/showthread...hreadid=557600



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default changing pictures according to cell value


Hi frsm
dear ken plz send me ur email to send u a file if it is possible


If you can't find it in my profile then...

it's a gmail account so after the @ is...

gmail.com

before the @ is...

kencjohnson

I believe doing it this way reduces the risk of spammers getting access
to yet another email address.

Ken Johnson

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
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
changing a cell to changing the link Jared Excel Worksheet Functions 7 May 8th 06 08:41 AM
Changing cell colour depending on another cells value... Web master Excel Discussion (Misc queries) 3 January 10th 06 12:30 PM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
Changing Cell formats to date fields automatically PCLIVE Excel Worksheet Functions 3 April 12th 05 10:34 PM


All times are GMT +1. The time now is 01:23 PM.

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

About Us

"It's about Microsoft Excel"