Solved

Import Routine from Excel into Access

Posted on 2001-06-22
4
516 Views
Last Modified: 2006-11-17
Does anyone have a generic import routine from Excel into Access? I am receiving a file in xls format weekly. What I would like to do is to name the file as file062201.xls (today), file062901.xls which would be the file I receive next week. I am going to save these files into one directory. I am looking for a generic import routine that would grab the data in excel and import into Access. This will replace any existing data in the table (as opposed to appending). Please help.
0
Comment
Question by:ay3314
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:Mikeh
ID: 6220413
1. you can link excel tables into access.  given you know the directory and file name then you can code this.

2. having linked the spreadsheet you could either run a query to replace the table data or do it in code.
0
 

Author Comment

by:ay3314
ID: 6222967
But that's what I am looking for - code!!
0
 
LVL 19

Accepted Solution

by:
frankytee earned 300 total points
ID: 6223281
ay3314, you've posted this question twice. you may as well delete this question and save 300 pts.

see my post at:
http://www.experts-exchange.com/jsp/qShow.jsp?qid=20140875

0
 

Expert Comment

by:Mikeh
ID: 6232450

sorry for the delay

here's some code

DoCmd.RunSQL ("delete * from accesstablename")

DoCmd.TransferSpreadsheet , acImport, accesstablename, "ExelPath",True(hasfieldnames)/False(doesnot),range"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question