Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Images in Excel (Excel 2003)

    Hi,

    I have a macro which calculates where to put some images/drawing withing a spreadsheet, on some PC's the position is correct and on others they are out of alignment, for example I have a chart showing progress against a plan by wee, I calulate where this week is and put a dotted line on the chart. This appears in the wrong place on some PC's.

    I assume it is related to the screen resolution, but I have checked and cannot find anything different.

    Any clues from anybody.

    Regards

    Mike

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Images in Excel (Excel 2003)

    Bottom line is that placing graphic elements on a chart is not reliable. Even if you get the line positioned correctly on the screen, it may be off when you print the chart.

    It's better to create the line as an element of the chart itself, there are various tricks to do so. For example an extra axis, or an extra series. If you wish, you can post (a stripped down version of) your workbook, I'm sure someone can come up with a way to do what you want within the chart itself.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Images in Excel (Excel 2003)

    Hi Hans,

    Thanks, that was just 1 example and the simplest I could think of, in fact I have lots of shapes, I am using a traffic light system as status updates so I draw a circle in a cell showing red, yellow or green, there are approimately 100 of these, we do not print them, we paste the image into a powerpoint slide, so there are aligned in columns on some PC's and not others.

    Regards

    Mike

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Images in Excel (Excel 2003)

    Have you set the shapes to "Move and size with cells"?

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Images in Excel (Excel 2003)

    Hi Hans,

    I think the answer is no.

    This is the code I am using to create the shape

    ActiveSheet.Shapes.AddShape(msoShapeOval, 400, intOvalPosCol, 23, 23).Select
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.SchemeColor = intGreenColor

    Where intOvalPosCol is the column position varible.

    Regards

    Mike

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Images in Excel (Excel 2003)

    Try

    With ActiveSheet.Shapes.AddShape(msoShapeOval, 400, intOvalPosCol, 23, 23)
    .Fill.Visible = msoTrue
    .Fill.Solid
    .Fill.ForeColor.SchemeColor = intGreenColor
    .Placement = xlMoveAndSize
    End With

  7. #7
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Images in Excel (Excel 2003)

    Hi Hans,

    When I put this code in I get and error #438 on that line

    Regards

    Mike

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Images in Excel (Excel 2003)

    Can't explain that - it works on my PC. Can you post a stripped down copy of your workbook? Remove sensitive data or replace it with dummy data.

  9. #9
    3 Star Lounger
    Join Date
    Nov 2001
    Posts
    224
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Images in Excel (Excel 2003)

    Hi Hans,

    This is not possible as the code is in the middle of large macro (8000+ lines) and I am not sure I can make it stand alone. I will try again, in case I did something odd.

    Regards

    Mike

  10. #10
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Images in Excel (Excel 2003)

    You have one macro that is 8000 lines long?? <img src=/S/yikes.gif border=0 alt=yikes width=15 height=15> Wouldn't it be wise to break it up into smaller subroutines and functions, as that must be a nightmare to maintain!
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •