Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Need help coping images (gif pictures) from worksheet to worksheet

  Asked By: Raju    Date: Feb 07    Category: MS Office    Views: 1011
  

I am currently working on a high priority project
for my IT Division's CIO.
The project is an Executive Dashboard (sheet1), with associated
"Project Status quad chart" worksheets (sheet2, sheet3, etc.).

I designed it so that he only will only need to view the Executive
Dashboard to get a quick status of all the projects underway in our IT
Division. Each PM has her/his own worksheet to update weekly. In
these worksheets, they update their status for four different elements
of the project: Cost (cell C1), Schedule (cell D1), Issues (Cell E1)
and Customer Temperature (Cell F1). The goal is to automatically
populate the changed images (simple oval images that can have their
colors changed by the PM) to their associated Cells on the dashboard
worksheet. The problem is that my attempts to script a VBA module to
make this happen, even using macros to see the code lines, end up with
an endless loop occurring. I feel I may be going about this in the
wrong way, and I desparately need your help.

What am I doing wrong? I am ready to instructed in the "right way"
:-) I would put in the code I used, but I'm afraid it is a hodgepodge
and it doesn't work anyway, so I've left it out.

Share: 

 

5 Answers Found

 
Answer #1    Answered By: Devrim Yilmaz     Answered On: Feb 07

My advice would be to share your code. We do not have something to work
with, to see why the endless loop  is occurring.

 
Answer #2    Answered By: Ella Brown     Answered On: Feb 07

Here is the code  that is giving me an endless "run" for my money, so
to speak:

Sub getJellyBean()
'
' This subroutine will select the graphic, inserted into a
cell  on the worksheet  called "Quad Chart1", and paste it
' into a cell on the first worksheet called "Dashboard"
' See code below:
Sheets("Dashboard").Select 'These three lines  will delete
Activesheet.Shapes.SelectAll 'the existing cell contents
Selection.Delete 'of the Dashboard worksheet.

Sheets("Quad Chart1").Select 'Copy the inserted image(a gif
Range("C2:C2").CopyPicture 'file ) into the clipboard.
Sheets("Dashboard").Select 'Now, paste that sucker onto
Range("C3").PasteSpecial 'into the associated cell on
' the Dashboard.
'That is it to my subroutine
End Sub

Please tear it apart. I'm so rusty as a programmer that I do not have
any ego to bruise. I really appreciate ANY help. I'm ready  to learn
from those who know so much more than I.

 
Answer #3    Answered By: Liam Bouchard     Answered On: Feb 07

: Here is the code  that is giving me an endless "run" for my
: money, so to speak:
:
: Sub getJellyBean()

What leads you to believe that this sub is an endless loop?
What errors, if any, are you receiving?

 
Answer #4    Answered By: Hababah Younis     Answered On: Feb 07

I am experiencing the endless looping on the main worksheet, as the
subroutine tries, over and over, to place the images  it grabs into the
cells they are supposed to go into.

It runs like this for quite a long time until, finally, it terminates
with an error message that says, in essence, "out of stack space."

 
Answer #5    Answered By: Edfu Massri     Answered On: Feb 07

Sorry. I just don't see anything wrong  with the sub routine. I
wouldn't have written it that way, but it doesn't look like it should
loop endlessly.

Try commenting out every line and run the script. If the problem
stops, try adding them back in one line at a time. Each time you add
a new line in, run your program. Eventually, you may isolate the
offending line and get a better grasp of the problem.

 




Tagged: