+ Reply to Thread
Results 1 to 3 of 3

ListObject DataBodyRange Returns Object Variable Not Set Error

  1. #1
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    ListObject DataBodyRange Returns Object Variable Not Set Error

    Hi all,

    Using Excel 2010.


    I would like to test a DataBodyRange of a ListObject and delete the DataBodyRange if the Rows.count >=1
    My code is returning an error:
    Run-time error '91':
    Object variable or With block block variable not set
    But I do not see a problem wi the code (Below)

    thx
    w

    Please Login or Register  to view this content.
    Kind regards,
    w

    http://dataprose.org

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: ListObject DataBodyRange Returns Object Variable Not Set Error

    The DataBodyRange object is Nothing when the table has no rows, so test for that.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    01-07-2004
    Posts
    314

    Re: ListObject DataBodyRange Returns Object Variable Not Set Error

    Thanks Andy,

    Your code is working perfectly!

    thx
    w

+ 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