"The file could not be accessed, try one of the following" when importing table in an Excel web query

6,967

Causes of errors investigation:

I believe the problem lies in two areas. Access, credentials to the website which may be blocking some aspect of Excel's query algorithm, which is hidden in the confines of Excel's program which is proprietary, which means we can't look at it. I assumed this and attempted to use Excel's Web Query from Web program and credentials were required to the root site. Performing a Query on the page, resulted in a null query. This satisfied my curiosities of why it's failing.

So I came up with a workaround. Also, manipulating a couple settings in the Option menu makes it possible to import this table.

How to overcome these errors, via workaround:

Step 1) Save the webpage document to your Desktop. While on the webpage perform: CTRL+S, Save-As, Webpage complete.

enter image description here

Step 2) Open your html file that you saved in Step-1. Use this local url as your query link.

enter image description here

Step 3) Perform the query in Excel as you did initially, using the url in Step-2: Data Tab → From Web → Address (step1) → Select by clicking the Option button before import process. In Options menu, make adjustment as to how you import. Use Full HTML Formatting by selecting the radio setting in the Options menu. Also uncheck the box labeled "Treat consecutive delimiters as one". Click Okay.

enter image description here

Step 4) Click import without selecting anything on the import page.Do not select the table before clicking import. In this particular situation only an entire import will execute successfully.

enter image description here

Finally the table imported.

enter image description here

Share:
6,967

Related videos on Youtube

Some_Guy
Author by

Some_Guy

Updated on September 18, 2022

Comments

  • Some_Guy
    Some_Guy over 1 year

    https://www3.epa.gov/twebhelp/WebHelp/tri_forms__instructionstri_forms_and_instructions6_new_table_ii_b_individually_listed_toxic_chemicals_arranged_by_cas_registry_number.htm

    Trying to pull the data from this table in Excel, but although it seems to detect the table fine, it fails when actually importing it. None of the suggested reasons in the prompt apply. Does anyone know what might be causing this error?

    The prompts I get are: enter image description here and enter image description here

    • Admin
      Admin over 7 years
      Excel is usually pretty good at pulling out tables constructed from divs from web pages. Atlohugh it isn't really relevant to the technical question relating to importing the table, for the record, it's a public document for industry reference. I found a more modern version provided at epa.gov/toxics-release-inventory-tri-program/… anyway, but I'm still curious as to the technical question of what causes excel to fail at that page.
    • Admin
      Admin over 7 years
      I tested the link and it seems that my initial curiosities were correct. I made some adjustment and cam up with a workaround for this unique question from the unique website. An import is possible with this workaround. See answer below.