Results 1 to 5 of 5
  1. #1
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664

    Gteeting ridor error file created on importing an Excel spreadsheet

    In the attached file is a db which when I import a Excel file, which is also attached creates a list of errors.



    My question is how do I get rid of the errors?

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed
    Attached Files Attached Files

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    A couple of points.

    First, even though a number of columns in the spreadsheet are hidden, Access still will import them. Hiding rows or columns is for users' convenience - Access ignores those settings.

    Second (and more important) - in order for a spreadsheet to import properly, the row format must be consistant - yours is not. It is designed for human consumption, not Access', and it contains a mix of header rows, data and summary information. Only rarely will a spreadsheet like that import properly with the TransferSpreadsheet method.

    When Access imports a spreadsheet into a new table, it determines the data type of each field by looking at the data in the first few entries in the corresponding spreadsheet column, excluding the first row if it contain the field names. If the first values found are numeric, it will make that table field a numeric, and then if text is found in a subsequent row, it generates a conversion error.

    Open and look at your spreadsheet. Thr values in first two columns (Count and Count) of rows 2 - 9 are numeric (or blank, which doesn't matter), so Access sets those fields in the table to numeric type. Now scroll down the spreadsheet to row 53. The data in column 1 of that row is "Project" - a text value. Access cannot convert "Project" to a numeric value, so it gives you a conversion error. The row is still imported, but with no value in that field.

    I think every single one of those import errors is due to the same problem.

    The easiest fix for the moment is to edit the spreadsheet to remove all the extra headers (leave the first one for field names) and the summary information at the bottom.

    That will take care of most of the errors, though there will still be a few caused by data in the hidden columns.

    Whether the data in the resulting Access table will be useful or not, I can't say. If distinguishing between the three groups in the spreadsheet is important, then you'll have to find another way of doing that because the headers are gone.

  3. #3
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I very much appreciate your answer. I was unaware as to how MS Access treats the cells thank you.

    I prepare my Excel spreadsheet before it is imported into MS Access. Initially, I have column names that take up several rows. I eliminate all the rows except the bottom row (a single row) with the remaining column names.

    This occurs before I ever import it into the MS access db and create a table.

    I may have forgotten how to do that, but I think I did it here. So my request is what do I do when I get errors after that?

    You say that Excel determines the format of a row from the first entries in the cells of that column. So what do I do when it determines a row
    to be numeric (from the first few cells in that row) and then the cells after the first few start containing non-numeric data?

    That is probably my biggest cause of error - after failing to get rid the multiline column names.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  4. #4
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    I am sorry to have to ask this question again. I see the errors that you are talking about, but I do not know what to do about them. Is there another way to import the Excel spreadsheet into Access?

    One that does not type the field based on the values of the first few values in the column's field's.

    I already remove, as I said in an earlier post, the all the rows except the bottom one in preparing my Excel Sheet for import to Access.

    That leaves only one row for the column titles. That should work in MS Access.

    I apparently need to remove even more fields because of the errors generated after I import the current prepared Excel spreadsheet.

    But then again there may be another way to do this which was my first question in this post.

    Either way, I am open to suggestions.

    Any help appreciated. Thanks in advance.

    Respectfully,

    Lou Reed

  5. #5
    Lou_Reed is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2015
    Posts
    1,664
    On further inspection, I believe that I see your point. The spreadsheet is made up of several sections, with each section having its own set of titles. Thus getting rid of the top titles is not enough. One must get rid of the titles on each section and leave only one line for the titles at the top of the spreadsheet.

    That would be effective. I just do not know how to do it. I can eliminate the titles with some simple VBA code.

    But when it comes to putting them back in when the table is exported back to Excel, well that is something else.

    I am just not sure what to do here.

    Any help appreciated.

    Thanks in advance.

    Respectfully,

    Lou Reed

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error on importing MS Excel file
    By Lou_Reed in forum Access
    Replies: 6
    Last Post: 09-19-2017, 06:39 PM
  2. Error on importing Excel file into MS Access.
    By Lou_Reed in forum Access
    Replies: 1
    Last Post: 09-01-2017, 02:15 PM
  3. Field F9 error when importing Excel file to existing table
    By dougdrex in forum Import/Export Data
    Replies: 2
    Last Post: 12-26-2014, 01:38 PM
  4. Error importing Excel file re search key not found
    By pcbrush in forum Import/Export Data
    Replies: 1
    Last Post: 10-03-2013, 03:19 PM
  5. Type error when importing Excel spreadsheet
    By jlmnjem in forum Database Design
    Replies: 2
    Last Post: 08-27-2006, 07:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums