473,466 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Import multiple Excel files to Access

rcollins
234 New Member
So I did the searching for someone to already have the answer. I had modified this code for My spreadsheets and database. I have marked the three lines in the code that are bad. Am I missing something?
At the click of a button, this is supposed to get info from all of the spreadsheets at once.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command25_Click()
  2.  
  3. Dim strfile As String
  4. ChDir ("D:\Daily Billables\Finished")
  5. strfile = Dir("*xls")
  6. Do While Len(strfile) 0 (Bad Line)
  7. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9
  8. "ImportFromThisTable" , "D:\UserData\ISE Database\ISE UI\ISE Database" & strfile (bad line)
  9. True, "tblClientContact"  (bad Line)
  10. strfile = Dir
  11. Loop
  12. End Sub
  13.  
Mar 23 '07 #1
1 1735
Denburt
1,356 Recognized Expert Top Contributor
Try this:
Expand|Select|Wrap|Line Numbers
  1. Do While Len(strfile) > 0 
  2. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,"ImportFromThisTable" , "D:\UserData\ISE Database\ISE UI\ISE Database" & strfile, True, "tblClientContact"
  3.  
Mar 23 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: deko | last post by:
I've been trying to use the Access Import Wizard to expedite importing data into my mdb. The nice thing about the wizard is that I can import from different file formats - txt, xls, even Outlook -...
2
by: amy | last post by:
Hi, all: i am a new end user of access, now I have many excel files need to import to One table in access (combine all excel files into one table in excel). In excel files, some columns will have...
11
by: MD | last post by:
Hello, I need to import a sheet of 884 different excel-file with same lay- out. The sheet name is 'Totaal' and is the same in all different files. Is there a script (module) in order to: 1....
3
by: theodorej | last post by:
......how do I select multiple Excel files to import into Access? Any insights would be deeply appreciated.
3
by: MarcGA | last post by:
(Excel 2003, Access 2003, XP, novice user here) I can't get Access to accept multiple Excel files to the same table. I can import the spreadsheets to a new table, but I need to import 23...
8
by: shenkel55 | last post by:
I'm using Access and Excel 2003. Using either the import wizard or code, I have the same problem. This problem only happens with Excel files automatically generated by Corp IT. If I try to do an...
5
by: hushens10 | last post by:
Access Naive - Help Needed I am using Access 2003 and Excel 2003. My goal is to create a database for a school where each student's testing information can be stored and organized so that it can...
7
by: ivancycheng | last post by:
I have around 400 excel files with same format (multiple sheets) and wants to import few sheets from excel to MS Access (XP version) for further processing. any one can advise me how to do it? (I'm...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
2
by: BlackEyedPea | last post by:
Hi I have no coding experience but am using access 2003 on XP in the hope that I can find some code that will.... Search a folder in my network & import any excel spreadsheets it finds within...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.