dcsimg
Results 1 to 4 of 4

Thread: code works with excel 2007, but not 2010

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    6

    code works with excel 2007, but not 2010

    Code:
    For I = 1 To EndOfLoop
        ActiveSheet.Shapes("Spinner" & I).Select
        With Selection
            .Min = 0
            .Max = 30
        End With
    Next I
    VBA gives me an error on the .min=0 line. It says "Object doesn't support this property or method". If I delete this portion of the code it runs fine until it runs into a strikingly similar loop...

    Code:
    For I = 1 To EndOfLoop
        ActiveSheet.Shapes("Spinner" & I).Select
        Selection.LinkedCell = ImpactsSheet & "!$Z$" & (I + 4)
        Selection.OnAction = "ModelChangeFlow"
    Next I

    In this code I get the same VBA error on the Selection.LinkedCell = ImpactsSheet & "!$Z$" & (I + 4) line. Is there something that changed in 2010 regarding shape properties? Thanks!

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,564

    Re: code works with excel 2007, but not 2010

    When I tried it, I got an error here:

    Code:
    ActiveSheet.Shapes("Spinner" & I).Select
    I had to add a SPACE after "Spinner" to get it to work. After doing that, it handled the MIN and LinkedCell okay.

    (In 2010)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2012
    Posts
    6

    Re: code works with excel 2007, but not 2010

    Thanks! This works for me too. Do you have any idea why?

  4. #4
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,564

    Re: code works with excel 2007, but not 2010

    The default for a Spin Button must have been "Spinner1" in 2007 and now changed to "Spinner 1" in 2010.

    Just guessing, since I can't re-create right now!

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width