Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shapes (XL97;SR2)

    In trying to condense the following code I've noted that Version 2 returns an error "Object does not support this property or method". Further research leads me to believe that Version 2 should exclude the ".Shapes" but that also does not work. Any suggestions?

    Sub ChangeShape()
    Sheets("Sheet1").Shapes("Drop Down 2").Select
    With Selection
    .ListFillRange = Range("MyRange")
    End With
    End Sub

    Condensed Version
    Sub ChangeShape2()
    Sheets("Sheet1").Shapes("Drop Down 2").ListFillRange = Range("MyRange")
    End Sub

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shapes (XL97;SR2)

    My experience with shapes and ranges says that you cannot assign a range to a shape property directly. You must first select the shape, then assign the range to the selected object.

    That's why your #1 works and #2 don't.

    I would love to know if my conclusion is really true.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shapes (XL97;SR2)

    Kevin,

    I found something deep inside MSoft's KB regarding the object. One has to include "ControlFormat" in the line of code such as:

    Sub ChangeShape2()
    Sheets("Sheet1").Shapes("Drop Down 2").ControlFormat.ListFillRange = Range("MyRange")
    End Sub

    I hope this helps relieve the frustration.
    John <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shapes (XL97;SR2)

    John,

    Great find. I'll give it a try. I need to create an autotext entry with a logo (shape object). I hope this works.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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