+ Reply to Thread
Results 1 to 2 of 2

Compile Error Method or data member not found

  1. #1
    ExcelMonkey
    Guest

    Compile Error Method or data member not found

    Been using John Walkenbach's Color Pallette code. It was working fine until
    I imported the module into a new file. I have been using it in XL2000.
    However I am not in XL 2003 and getting a Compile Error.

    The line: Function GetAColor() As Variant is highlighted in yellow and the
    line: .ColorButton = in the line: Set Buttons(ButtonCount).ColorButton = ctl
    is highlighted in grey.

    Does this have something to do with XL 2003?

    Function GetAColor() As Variant
    ' Displays a dialog box and returns a
    ' color value - or False if no color is selected
    Dim ctl As Control
    Dim ButtonCount As Integer
    ButtonCount = 0
    For Each ctl In UserForm1.Controls
    ' The 56 color buttons have their Tag property set to "ColorButton"
    If ctl.Tag = "ColorButton" Then
    ButtonCount = ButtonCount + 1
    Set Buttons(ButtonCount).ColorButton = ctl
    If WorkbookIsActive Then
    ' Get colors from the active workbook's palette
    Buttons(ButtonCount).ColorButton.BackColor = _
    ActiveWorkbook.Colors(ButtonCount)
    Else
    ' Get colors from this workbook's palette
    Buttons(ButtonCount).ColorButton.BackColor = _
    ThisWorkbook.Colors(ButtonCount)
    End If
    End If
    Next ctl
    UserForm1.Show
    GetAColor = ColorValue
    End Function

  2. #2
    Jim Thomlinson
    Guest

    RE: Compile Error Method or data member not found

    Check for a missing reference. Whene there is a missing reference the oddest
    things get flagged as errors. Tools -> References (look for anything that
    starts with missing)
    --
    HTH...

    Jim Thomlinson


    "ExcelMonkey" wrote:

    > Been using John Walkenbach's Color Pallette code. It was working fine until
    > I imported the module into a new file. I have been using it in XL2000.
    > However I am not in XL 2003 and getting a Compile Error.
    >
    > The line: Function GetAColor() As Variant is highlighted in yellow and the
    > line: .ColorButton = in the line: Set Buttons(ButtonCount).ColorButton = ctl
    > is highlighted in grey.
    >
    > Does this have something to do with XL 2003?
    >
    > Function GetAColor() As Variant
    > ' Displays a dialog box and returns a
    > ' color value - or False if no color is selected
    > Dim ctl As Control
    > Dim ButtonCount As Integer
    > ButtonCount = 0
    > For Each ctl In UserForm1.Controls
    > ' The 56 color buttons have their Tag property set to "ColorButton"
    > If ctl.Tag = "ColorButton" Then
    > ButtonCount = ButtonCount + 1
    > Set Buttons(ButtonCount).ColorButton = ctl
    > If WorkbookIsActive Then
    > ' Get colors from the active workbook's palette
    > Buttons(ButtonCount).ColorButton.BackColor = _
    > ActiveWorkbook.Colors(ButtonCount)
    > Else
    > ' Get colors from this workbook's palette
    > Buttons(ButtonCount).ColorButton.BackColor = _
    > ThisWorkbook.Colors(ButtonCount)
    > End If
    > End If
    > Next ctl
    > UserForm1.Show
    > GetAColor = ColorValue
    > End Function


+ 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.6.0 RC 1