Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8557675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:37:38+00:00 2026-06-11T15:37:38+00:00

I have a database that links to an Excel spreadsheet. When adding the linked

  • 0

I have a database that links to an Excel spreadsheet. When adding the linked table manually, I have no problems (I just follow the little wizard and the table is created perfectly). I am trying to automate that using VBA:

Dim db as DAO.Database
Dim tdf as TableDef

Set db = CurrentDB
Set tdf = db.CreateTableDef("linked_table")
tdf.Connect = "Excel 8.0;HDR=YES;IMEX=2;DATABASE=" & Me.txtExcelFile  ' references form field
db.TableDefs.Append tdf  ' Here's where I get a run time error

Unfortunately I get run-time error 3264 on the last line and it says, “No field defined–cannot append TableDefs or Index.” I’m not even sure why the last line is needed (it seems from the documentation I’ve found that it’s to add the table to the TableDefs collection of the database). Any suggestions on resolving the error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:37:40+00:00Added an answer on June 11, 2026 at 3:37 pm

    You are missing:

    tdf.SourceTableName = "Sheet1$"
    

    Or whatever range or sheet name you wish to use as the table.

    So, in all, this works for me:

    Dim db as DAO.Database
    Dim tdf as TableDef
    
    Set db = CurrentDB
    Set tdf = db.CreateTableDef("linked_table")
    tdf.SourceTableName = "Sheet1$"
    tdf.Connect = "Excel 8.0;HDR=YES;IMEX=2;DATABASE=" & Me.txtExcelFile  ' references form field
    db.TableDefs.Append tdf
    

    You can also link Excel using TransferSpreadsheet

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel spreadsheet of some product data, (just a simple table) that
I have a database that which contains two tables, links and tour. Tour is
I have a form that adds links to a database, deletes them, and --
Let's say I have a user that entered 12 links into the database but
I have a database that has a table email_eml that stores 3 attributes name_eml,
I have a tree in my database that is stored using parent id links.
I have a database of links that users can submit. Every time a user
I have a column in my database that stores images that are links, when
We have an existing database link in an Oracle database that links to data
There are some links in my database that do not have a trailing slash,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.