+ Reply to Thread
Results 1 to 7 of 7

ShowAllData Method Returns Error

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

    ShowAllData Method Returns Error

    Hi all,

    Using Excel 2013 64-bit.
    I recrded a bit of code while clearing a filter.

    The resulting code gave me the ShowAllData Method
    So I tried using in my procedure but I am receiving an error:
    Run-time error '1004':
    ShowAllData Method of Worksheet Class Failed
    Any idea what I am doing wrong?
    Thanks
    w

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

    http://dataprose.org

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: ShowAllData Method Returns Error

    Hi, goss,

    your code say
    Please Login or Register  to view this content.
    Maybe you check for an Autofilter prior to that command by
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

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

    Re: ShowAllData Method Returns Error

    Thanks Holger,

    I revised the code slightly at your suggestion.
    Now receiving this error message
    Run-time error '1004':
    This command requires at least two rows of source data. you cannot use the command on a selection in only one row. Try the following...
    Thanks
    w

    Revised:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: ShowAllData Method Returns Error

    Hi, goss,

    maybe like this:
    Please Login or Register  to view this content.
    Ciao,
    Holger

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

    Re: ShowAllData Method Returns Error

    Thanks Holger,

    Same error.
    It's something I've coded futher down that creates the filter and hidden rows, but I do not understand why the code above does not handle it?
    ExportToPDF2 contains the updated code

    Thanks
    w
    Attached Files Attached Files

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: ShowAllData Method Returns Error

    Hi, goss,

    you clear the contents on the sheet Control, you put in headers in the first line and then you want to execute an advanced filter on data not present - to me the run time error is understandable as I donīt know why you want to do that. Workaround would be to check the last filled line and only execute the filerting if the number of filled rows is at least 3 or greater.

    Ciao,
    Holger

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

    Re: ShowAllData Method Returns Error

    Thanks Holger,

    The problem was here:
    Please Login or Register  to view this content.
    Should be:
    Please Login or Register  to view this content.
    Since I am using advanced filter.

    Thanks for your help
    Kind regards,
    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