Results 1 to 2 of 2
  1. #1
    tpcervelo is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    28

    Import Excel with SQL - again

    The following does work however it gets wierd...



    SELECT T1.*, 1 AS SheetSource INTO ExcelImport
    FROM (Excel 12.0;HDR=NO;IMEX=1;Database=C:\Access2007\ODBC-Writeback\SFtest.xlsx) [TCM IMPORT - SF$A10:L65536] AS T1;

    If I change the name of the workbook (such as SFtest.xlsx to SFpipe.xlsx) Access returns an error of "Syntax error on Join Operation" when I try to save the changes.

    If I key in or cut/paste the working SQL string to a new query I get the same error.

    If i rename the new workbook that I want to test to the name in the working SQL (I haven't changed the SQL qeury or tried to save it...just renamed the xlsx then the import works.

    any ideas???

  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682

    Excel Import

    I'm not sure about the answer to you question but attached is what I use to do excel imports. It works fairly nicely for xlsx files as well (changing the code for xlsx.)

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

Similar Threads

  1. Import from Excel Using TransferSpreadsheet
    By P5C768 in forum Import/Export Data
    Replies: 10
    Last Post: 05-01-2013, 01:17 PM
  2. Cannot import excel or text files
    By donald_s in forum Access
    Replies: 2
    Last Post: 04-13-2010, 11:48 PM
  3. VBA to open excel, import on close of excel
    By bdaniel in forum Programming
    Replies: 0
    Last Post: 03-20-2010, 02:45 PM
  4. Import single cell from excel
    By zippy483 in forum Import/Export Data
    Replies: 9
    Last Post: 02-24-2010, 02:16 PM
  5. How to import named range from excel
    By timpepu in forum Import/Export Data
    Replies: 1
    Last Post: 02-19-2010, 11:26 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