Solved

Create Spreadsheet

Posted on 2001-06-19
4
258 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 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

19 Experts available now in Live!

Get 1:1 Help Now