+ Reply to Thread
Results 1 to 7 of 7

Error Object doesn't support this property or method

  1. #1
    Registered User
    Join Date
    03-31-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    25

    Error Object doesn't support this property or method

    Hi, I am getting the following error 'Run time error 43: Object doesn't support this property or method ' on the line

    Set FoundDate = wb2.ws2.Rows("A").Find(DateValue(Now), LookIn:=xlValues, lookat:=xlWhole)

    My code is

    Sub FindToday()

    Dim FoundDate As Range
    Dim wb1 As Workbook
    Dim wb2 As Workbook
    Dim ws1 As Worksheet
    Dim ws2 As Worksheet

    Set wb1 = ActiveWorkbook
    Set wb2 = Workbooks("Test.xlsx")
    Set ws1 = wb1.ActiveSheet
    Set ws2 = wb2.Worksheets("Control")

    Set FoundDate = wb2.ws2.Rows("A").Find(DateValue(Now), LookIn:=xlValues, lookat:=xlWhole)

    If Not FoundDate Is Nothing Then
    wb1.ws1.Range("B2:B17").Copy
    FoundDate.Offset(0, 15).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, False

    End If
    End Sub

    Any help is much appreciated

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Error Object doesn't support this property or method

    Please use code tags with your code as per forum's rule.

    There is no row A but column A
    Please Login or Register  to view this content.
    This is likely to be wrong as well

    DateValue(Now)
    Last edited by AB33; 10-12-2015 at 12:10 PM.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error Object doesn't support this property or method

    It should just be ws2 not wb2.ws2.

    That will fix the error mentioned in your post but, as AB33 has pointed out, you will get an error with Rows("A").

    What row/column/range do you actually want to search?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    03-31-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    25

    Re: Error Object doesn't support this property or method

    Thanks both that was a silly error on my part and I'm now not getting an error message

    However the code isnt copying the the cells I specified into the second workbook

    Essentially I want the code to find todays today in the first row of the second workbook and copy cells B2:B17 from the first workbook into corresponding column where today's date is from row 16

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Error Object doesn't support this property or method

    Can you post the code you have now?

    PS Can you add code tags when posting code?

  6. #6
    Registered User
    Join Date
    03-31-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    25

    Re: Error Object doesn't support this property or method

    Please Login or Register  to view this content.
    Thats my latest code, there is no error but nothing is copied in my desired spreadsheet

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Error Object doesn't support this property or method

    You have same mistake here:
    Please Login or Register  to view this content.
    It must be only:
    Please Login or Register  to view this content.
    If you do not see copy it will be because the date is not found.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

+ 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. [SOLVED] Getting run-time error object doesn't support this property or method
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2015, 02:14 AM
  2. Run time error '438': Object doesn't support this property or method
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2014, 04:59 AM
  3. Run-time error '438': Object doesn't support this property or method
    By ThaGreenMoose in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2011, 01:17 PM
  4. Object Doesn't support this property or method Error
    By andrew c. in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2011, 02:07 PM
  5. error '438', Object doesn't support this property or method.
    By ironmonkey888 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2010, 09:23 AM
  6. Run-time error '438': Object doesn't support this property or method
    By ophelia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-23-2007, 05:27 AM
  7. Replies: 1
    Last Post: 07-12-2005, 04:05 PM

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