Solved

Import Routine from Excel into Access

Posted on 2001-06-22
4
479 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
  • 2
4 Comments
 

Expert Comment

by:Mikeh
Comment Utility
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
Comment Utility
But that's what I am looking for - code!!
0
 
LVL 19

Accepted Solution

by:
frankytee earned 300 total points
Comment Utility
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
Comment Utility

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now