473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

VB code in access to import and export of excel

Hello ,

How to import and export the excel file into Access through VB Code


let me know , if anybody knows the same
Mar 10 '08 #1
4 2245
Hello ,

How to import and export the excel file into Access through VB Code


let me know , if anybody knows the same
Hello sethson22, try using TransferSpreadsheet method for import.
Mar 10 '08 #2
Hello sethson22, try using TransferSpreadsheet method for import.

i don't have any idea about this method , can you elobrate more .............how i can use this method
Mar 11 '08 #3
i don't have any idea about this method , can you elobrate more .............how i can use this method
Access Help or Google offer very good explanations on this topic.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
  2.                                             "tblAccess", "YourExcelTable",    False, "A2:Z16000"
  3.  
This code snippet imports an Excel workbook named "YourExcelTable" into "tblAccess" - this your target table within your Access database. If you haven't created one, TransferSpreadsheet will create it automatically.

"A2:Z16000" is imported range.

Beware if your Excel workbook has multiple spreadsheets! Then you'll have to import them separately, and you have to tell it VBA in the range. For example, "Sheet1!A1:D5" will import only cells A1:D5 from Sheet1, but won't touch other worksheets.

Good luck,
OfficeDummy
Mar 11 '08 #4
dbpros
15
If you use the Access import wizard, it will let you build/create an Import Specification, which tells Access how to interpret each field (as number, string, etc) and where to put it. I believe you can create an Export Specification as well.

hope this helps

http://www.db-pros.com
Mar 11 '08 #5

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

Similar topics

3
by: Gaffar | last post by:
Hello, how to export ms-access tables information to excel sheet using ASP. please give sample code. it is very urgent to me or if u have no idea please give any news group to solve my...
5
by: jsudo | last post by:
I have a Access database with a large amount of records (close to 500,000) that I would like to export to Excel. I found out that Excel has the capability of of about 65,000 rows so I know I...
3
by: Marc Nadeau | last post by:
Hi, I have a new project that consist of transfering a JD Edwards Database to an MS Access database. I am just starting to learn how those 2 databases works. What is the general idea behind...
13
by: Arno R | last post by:
Hi all, I will have to handle a lot of really 'nice' data in a LOT of Excel sheets. It is all about music files (Billboard top 100) I am afraid there really is a sheet for every year ... (Don't...
25
by: DFS | last post by:
I have a job to automatically import Excel data and post to database tables, via a point-click interface. Choose-file-and-it-does-the-rest kind of thing. Cient stores data in columns in his...
5
by: hharriel | last post by:
Hi, I am hoping someone can help me with an issue I am having with excel and ms access. I have collected data (which are in individual excel files) from 49 different school districts. All...
1
by: Pauline | last post by:
Dear all, I have an enormous database (Access 2003) containing sales information, and an Excel tool to enable end users to do planning and forecasting. Untill now I would create several queries,...
12
by: Mourad | last post by:
I need to attach (link) a table in SQL Server 2005 database to an Access 2.0 front-end database: On Access 2.0: Click File\Attach Table..., select <SQL Databaseclick OK On the "SQL Data...
4
NeoPa
by: NeoPa | last post by:
Introduction: Macro Security Levels in MS Office applications are recommended to be set to High. This stops any VBA code associated with a project from running, unless it is signed (with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.