Results 1 to 5 of 5
  1. #1
    RickK is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    16

    Problem importing data from a .csv file

    My Access database has a button that runs a macro that imports data from a inventory.csv file located in the same folder as the DB. It places this data in a table called inventory. I have this DB running on a several PC's using Office 2010 and this function works as expected.



    But, I have one PC that we just loaded this DB on and when I try to run this macro Access throws the error: Office has detected a problem with this file. To help protect your computer this file cannot be opened.

    I tried the suggestions I found on line : In Access I added the folder that the file is located in to the trusted locations. I tried a new file in case this one is corrupted. In the CSV file which is Excel, I went into the Trust Center settings , File Block Settings and deselected everything in both columns.

    I am running out of ideas. Why does this work on other systems running Office 2010 but not this one?

    Help please
    Rick

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    That is the strangest error I have NEVER seen. Does that PC have anti virus?
    access wouldn't detect errors like that.
    does the PC use a different version?
    did you try attaching the cvs as a table?

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    Attachment 25870
    On the target computer, check the bottom of the property dialog of the .csv.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I would suspect the trusted locations thing would solve the problem. So this other computer has a full version of Access? Maybe looking into the advanced options of that computer's trusted locations within Access will glean some light. IIRC, there are options for importing and or specifying documents like Word and Excel docs.

    How are you importing? Did you use the Wizard to create the button? I would use the Wizard to import a Text file using Advanced options and save that procedure with a name. Then, I would crate a button that uses VBA to call the saved Import procedure.

    I believe the TransferText method of the DoCmd Object is still valid ...
    Code:
    DoCmd.TransferText acImportDelim, "ImportName", "TableName", "FilePathAndName", 0 'Zero indicates that there are not any field names in the file

  5. #5
    RickK is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    16
    I figured it out.

    At first I thought it was an Access issue, so I went into Trust Center in Access and added the folder to the trusted list. I went back into the excell file and did the same thing and that fixed my issue.

    Thanks for all of the ideas.

    Rick

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

Similar Threads

  1. problem with numbers when importing txt file into Access
    By Atoga in forum Import/Export Data
    Replies: 7
    Last Post: 04-27-2015, 06:02 PM
  2. importing data from an excel file
    By slimjen in forum Access
    Replies: 3
    Last Post: 09-21-2011, 12:38 PM
  3. Importing data from a .txt file
    By The Dad in forum Access
    Replies: 2
    Last Post: 08-25-2011, 01:45 PM
  4. Importing new data from same file once a week
    By fclanton in forum Import/Export Data
    Replies: 0
    Last Post: 11-11-2010, 09:22 AM
  5. importing data from csv file
    By sbglobal in forum Import/Export Data
    Replies: 2
    Last Post: 08-22-2010, 11:45 AM

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