+ Reply to Thread
Results 1 to 2 of 2

Method or Data Member Not Found

  1. #1
    Registered User
    Join Date
    05-13-2015
    Location
    Hartford, CT
    MS-Off Ver
    10
    Posts
    6

    Method or Data Member Not Found

    I've seen a lot of this in the Forums, but it's hard to search on a specific error. I am having a problem with a spreadsheet using a ListBox. Here's my problem;

    I have a ListBox on a worksheet called ReadMe. The beginning of my Macro look like this;

    Sub CreateMFStuff()
    Dim sLine As String
    Dim sEmail As String
    Dim sMFLog As String
    Dim sMFPass As String
    Dim sOutline As String
    Dim FilePols As String
    Dim sRange As String

    Dim wsCurr As Worksheet
    ' Dim wsRead As Worksheet

    Dim FSO As Object
    Dim FSO2 As Object
    Dim oFile As Object
    Dim oFile2 As Object

    Set wsRead = ActiveWorkbook.Worksheets("ReadMe")

    For A = 0 To wsRead.ListBox1.ListCount - 1
    If wsRead.ListBox1.Selected(A) = True Then
    wsRead.Cells(x, 4).Value = wsRead.ListBox1.List(A)
    x = x + 1
    End If
    Next

    The declaration of the wsRead worksheet is commented out and the Macro works. If I un-comment it, I get the 'Method or Data Member Not Found' pointing to the '.ListBox1 area'.

    Since I can comment it out, I'm good. I was just curious why it was happening.

    Thanks

  2. #2
    Forum Contributor kalbasiatka's Avatar
    Join Date
    02-27-2016
    Location
    Brest, Belarus
    MS-Off Ver
    2021
    Posts
    224

    Re: Method or Data Member Not Found

    Why do we assign variables to objects, when you can go directly to the sheet.
    Please Login or Register  to view this content.
    To do it for me and help me it is 2 different things!
    Sorry for my english, blame Google translator

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Method or data member not found
    By Rob K in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-27-2015, 03:50 PM
  2. [SOLVED] Error: Method or Data Member Not Found
    By k64 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-21-2015, 08:39 AM
  3. Compile error method or data member not found
    By sureshpunna in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2014, 09:00 AM
  4. Method or data member not found
    By katieshields in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-02-2014, 08:49 AM
  5. [SOLVED] error: Method or Data Member not found
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2013, 11:01 AM
  6. [SOLVED] Compile error: Method or data member not found.
    By ndtsteve in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-10-2012, 11:31 AM
  7. Method or Data Member not Found
    By Syed Haider Ali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2005, 09:27 AM

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