+ Reply to Thread
Results 1 to 5 of 5

Thread: What XL version shape shadow blur,size, style added?

  1. #1
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Michiagn
    MS-Off Ver
    Excel 2003/2007
    Posts
    350

    What XL version shape shadow blur,size, style added?

    Hello!

    This is part of a code which cycles through each shape on a sheet and displays a list of info about those shapes.

    My home computer uses Excel 2010 and the code compiles and runs fine. When I run it from Excel 2003, it gives a "Method or data member not found." error for these: shp.Shadow.Blur, Size, and Style.

    I can't find anything which talks about these or which version of XL they were added.

    Anyone have any background info on these?


    And Is this the right syntax for the version code?

    If Val(Application.Version) >= 12 Then
    ...code for 2007/2010 stuff
    end if
    Shape code
    Private Sub m_DisplayDetails(Shp As Shape, CommentAddress As String)
    
        Dim lngIndex As Long
        On Error Resume Next
        ListBox2.Clear
        lngIndex = 0
        
        ListBox2.AddItem "Shadow.Blur"
        ListBox2.List(lngIndex, 1) = ShapeRange.Shadow.Blur
        lngIndex = lngIndex + 1
        
        ListBox2.AddItem "Shadow.Size"
        ListBox2.List(lngIndex, 1) = Shp.Shadow.Size
        lngIndex = lngIndex + 1
    
        ListBox2.AddItem "Shadow.Style"
        ListBox2.List(lngIndex, 1) = Shp.Shadow.Style
        lngIndex = lngIndex + 1
    
        End Sub
    Respectfully,

    Lost

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Apparently I can't say
    MS-Off Ver
    Apparently I can't say
    Posts
    8,274

    Re: What XL version shape shadow blur,size, style added?

    They were added in 2007.

  3. #3
    Valued Forum Contributor
    Join Date
    02-26-2010
    Location
    Michiagn
    MS-Off Ver
    Excel 2003/2007
    Posts
    350

    Re: What XL version shape shadow blur,size, style added?

    romperstomper,

    Thanks!

    I tried to fix the code, but it still won't compile (same error: Method/Member not found.).

    Any ideas to fix this?

    'end 2003 code
    'start 2007 code
    If Val(Application.Version) >= 12 Then
     
        ListBox2.AddItem "Shadow.Blur"
        ListBox2.List(lngIndex, 1) = Shp.Shadow.Blur
        lngIndex = lngIndex + 1
    
    
        ListBox2.AddItem "Shadow.Size"
        ListBox2.List(lngIndex, 1) = Shp.Shadow.Size
        lngIndex = lngIndex + 1
    
        ListBox2.AddItem "Shadow.Style"
        ListBox2.List(lngIndex, 1) = Shp.Shadow.Style
        lngIndex = lngIndex + 1
    End If
    ' end 2007 code
     'back to 2003 code
    Respectfully,

    Lost

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Apparently I can't say
    MS-Off Ver
    Apparently I can't say
    Posts
    8,274

    Re: What XL version shape shadow blur,size, style added?

    It won't compile in 2003 as the method doesn't exist (the application check only takes place at runtime).
    You need to put any 2007 specific code into its own module and only call that after checking the version. The code will still not compile in 2003 if you actively try to compile the project, but it will work at runtime since the other module won't get called at all and therefore the compiler will ignore it.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    11,351

    Re: What XL version shape shadow blur,size, style added?

    You could also declare the shp object as Object rather than Shape.

    Note you will lose intellisense if you do that.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0