Solved

Create Spreadsheet

Posted on 2001-06-19
4
263 Views
Last Modified: 2010-05-02
How can I create an Excel spreadsheet from an Access table?
0
Comment
Question by:northeyk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 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