Solved

Create Spreadsheet

Posted on 2001-06-19
4
259 Views
Last Modified: 2010-05-02
How can I create an Excel spreadsheet from an Access table?
0
Comment
Question by:northeyk
  • 3
4 Comments
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6205964
Try this, I think it is what you want

http://www.freevbcode.com/ShowCode.Asp?ID=2182

Regards
Andrew
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6205975
or even better this one

Export an Access Table to an Excel Spreadsheet
http://www.freevbcode.com/ShowCode.Asp?ID=2794
0
 
LVL 5

Accepted Solution

by:
AndrewDev earned 50 total points
ID: 6205978
This is the code from the above link

Private Sub ExportOneTable()

'EXPORTS TABLE IN ACCESS DATABASE TO EXCEL
'REFERENCE TO DAO IS REQUIRED

Dim strExcelFile As String
Dim strWorksheet As String
Dim strDB As String
Dim strTable As String
Dim objDB As Database

'Change Based on your needs, or use
'as parameters to the sub
strExcelFile = "C:\My Documents\MySpreadSheet.xls"
strWorksheet = "WorkSheet1"
strDB = "C:\My Documents\MyDatabase.mdb"
strTable = "MyTable"

Set objDB = OpenDatabase(strDB)

 'If excel file already exists, you can delete it here
 If Dir(strExcelFile) <> "" Then Kill strExcelFile

objDB.Execute _
  "SELECT * INTO [Excel 8.0;DATABASE=" & strExcelFile & _
   "].[" & strWorksheet & "] FROM " & "[" & strTable & "]"
objDB.Close
Set objDB = Nothing

End Sub

0
 

Expert Comment

by:romilson
ID: 6205988
Hello ,
If you won't to use progremming ,,
use can enter in Excel and make the steps:

- Click in "Data" menu
- Click in Obtain External Data
- Create new Query
- select access data base
- select the access data base file (.mdb)
- select the table
and click and next till finish

:-)

Romilson
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

930 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

10 Experts available now in Live!

Get 1:1 Help Now