Results 1 to 4 of 4
  1. #1
    Gaby2811 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    2

    Import Excel file into an existing table via a macro


    When using my importing file, the data from the excel file get imported but not the last column. I think the problem is that the excel file has a record in one of the field with almost 400 characters. I changed the format of this field to memo but still I have the issue. I realized that when I use my import macro and the excel file is open, the file get imported fine but if I try to imported when the excel file is close, the last column of the excel file does not get uploaded. Does anyone knows why it works when the excel file is open vs when it is closed?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    it shouldnt import at all if the file is open.
    what is the command you use? transferspreadsheet or a query?

  3. #3
    Gaby2811 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    2
    I have a macro with the ImportExportSpreadsheet command. This command looks for the location of my excel file in my drive and automatically import the data into my table. The last column of the excel file only get populated if it is open. If it is closed it will not uploaded the data for the last column.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Instead of transferspreadsheet,
    attach the file as a table. The field should show up there.
    then run an append query.

    steps:
    save the new XL file and overwrite the same file everytime (file2import.xls)
    run the macro, (which runs the append query)
    done.

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

Similar Threads

  1. Replies: 5
    Last Post: 04-26-2016, 05:30 AM
  2. Newbie Import. Update Field of Existing Records from Excel File
    By gedwards913 in forum Import/Export Data
    Replies: 8
    Last Post: 03-12-2015, 07:53 PM
  3. Replies: 3
    Last Post: 10-08-2014, 11:05 AM
  4. Import Excel File using a Macro
    By smakkiee in forum Access
    Replies: 6
    Last Post: 04-28-2014, 08:45 AM
  5. Import Excel File Using Macro?
    By oregoncrete in forum Import/Export Data
    Replies: 0
    Last Post: 04-05-2011, 12: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