Results 1 to 6 of 6
  1. #1
    Soupy8728 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Mar 2024
    Posts
    30

    Linking to Excel Spreadsheet

    Good morning all,

    I have an Excel spreadsheet that gets downloaded daily from another source. The first 3 rows are unusable data and need to be ignored. I cannot go in every time and delete the rows as that would be impractical. 2nd part of my dilemma: I can't import the data into a temp table as some of the data gets truncated as access "looks" at the first 8 rows of data and if they don't meet the requirements, data gets truncated. Here is what I'd like to do:

    1. Download file and put in a specific folder.
    2. Use Access to link to this file but start on row 3 (where the actual headers reside).


    3. Have this link stay in place and just replace the Excel file in the specified folder on a daily basis (same file name).

    I've played around with the Connection string box on the Linked Table Manager but I just can't get it to work. I don't need to edit any of the data on the Excel file, simply view it from Access. Thanks as always!

    Sincerely,
    Carl aka Soupy8728

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,575
    What identfies those first three rows?
    You could easily delete them with automation.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Soupy8728 is offline Advanced Beginner
    Windows 11 Access 2016
    Join Date
    Mar 2024
    Posts
    30
    Quote Originally Posted by Welshgasman View Post
    What identfies those first three rows?
    You could easily delete them with automation.
    The first 3 rows are just information about the Excel file such as date downloaded, file name. I don't need to see that stuff. How would I go about deleting those rows with automation and where would that automation reside? Within Access? Thank you.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,575
    Well you could exclude them if you knew what was in the first column and that data was unique.?
    You would carry out the automation from within Access. Just open the file after download, delete rows 1 -3, save the file then process it as you require.

    If you could identify them, then exclude them in the query that extracts the data.

    ChatGPT reckons you can do it with a sub query.
    Code:
    SELECT *
    FROM MyExcelData
    WHERE ID NOT IN (
        SELECT TOP 3 ID
        FROM MyExcelData
        ORDER BY ID
    )
    ORDER BY ID;
    You might not need the ORDER clauses.

    https://chatgpt.com/share/689c86e8-5...9-ed5fa3d9586c
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,942
    Use a sql query where you can specify a range

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,942
    I would use this sql

    SELECT
    *
    FROM
    [Data$A4:G] AS xlData IN 'C:\Path\filename.XLSX' [Excel 12.0;HDR=yes;IMEX=0;ACCDB=Yes]

    for this spreadsheet
    Click image for larger version. 

Name:	image_2025-08-13_145151052.png 
Views:	13 
Size:	33.0 KB 
ID:	53183


    produces this result
    Click image for larger version. 

Name:	image_2025-08-13_145444078.png 
Views:	13 
Size:	31.6 KB 
ID:	53184

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

Similar Threads

  1. Replies: 6
    Last Post: 07-10-2019, 07:34 PM
  2. Replies: 4
    Last Post: 03-19-2019, 08:35 AM
  3. Replies: 1
    Last Post: 04-10-2017, 10:06 AM
  4. Linking Excel spreadsheet
    By nikogeorgiev in forum Import/Export Data
    Replies: 9
    Last Post: 05-16-2013, 08:24 AM
  5. Replies: 1
    Last Post: 03-05-2012, 04:21 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