Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2007, 06:29 AM
Registered User
 
Join Date: Mar 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data transfer from Access to Excel

Hi all,
       I need the VBA code to transfer data present in the database table of Access into an Excel sheet.

 
Old April 16th, 2007, 07:54 AM
Authorized User
 
Join Date: Jan 2006
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 all u need is to use the export to command in the macros section.

filling the parameters
1.name of tablein accessu want to export to.
2.the format u want it exported to excel.
that all


 
Old June 1st, 2007, 10:30 AM
pjm pjm is offline
Authorized User
 
Join Date: Jul 2006
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Simple:

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
        TableName, ExcelFile, , SheetName

You can leave off the SheetName and the last 2 commas to put your table in the default sheet (which I believe is "Sheet1"). Note that you can also use a query name in place of the table name.

-Phil-





Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfer data from Excel to Access JezLisle Excel VBA 0 December 13th, 2007 01:25 PM
Transfer Dynamic Data from Excel to Access DB ? poorheler Excel VBA 2 July 2nd, 2007 11:11 AM
how to transfer data from excel to Access database swaroop Access VBA 5 April 13th, 2007 09:02 AM
how to transfer data from excel to Access database swaroop Excel VBA 1 April 12th, 2007 10:45 AM
Transfer Data to Excel one cell at a time mahulda ASP.NET 1.0 and 1.1 Basics 2 April 28th, 2004 04:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.