By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,665 Members | 1,513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,665 IT Pros & Developers. It's quick & easy.

Export DS to Excel

P: n/a
It looks like this is a very popular subject, but all the previous messages
have been deleated from the server. In my application, I need to export a
table in my MSAccess database to an Excel 2003 spreadsheet. I have no
trouble with individual ranges, but am having trouble finding a good example
where the data from an entire table is written to the worksheet.

Thanks in advance for any suggestions.

David

Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
David,

Why don't you ask it in the newsgroup

microsoft.public.excel.programmer

And than direct from Access to VBA.

Kelly wrote once a sample from dataset to xls,
I have the idea that the sample has some overhead, however it works.

http://www.kjmsolutions.com/datasetarray.htm

I hope this helps,

Cor
Nov 21 '05 #2

P: n/a
On Mon, 12 Sep 2005 17:51:42 -0500, "David" <dm*******@hotmail.com> wrote:

It looks like this is a very popular subject, but all the previous messages
have been deleated from the server. In my application, I need to export a
table in my MSAccess database to an Excel 2003 spreadsheet. I have no
trouble with individual ranges, but am having trouble finding a good example
where the data from an entire table is written to the worksheet.


See if the following works for you:

Dim AccessConn As New System.Data.OleDb.OleDbConnection("Provider=Micros oft.Jet.OLEDB.4.0;"
& _
"Data Source=e:\My Documents\db1.mdb")

AccessConn.Open()

'New sheet in Workbook
Dim AccessCommand As New System.Data.OleDb.OleDbCommand("SELECT * INTO [Excel
8.0;DATABASE=e:\My Documents\Book11.xls;HDR=NO;].[Sheet7] from [Table7]", AccessConn)

AccessCommand.ExecuteNonQuery()
AccessConn.Close()
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #3

P: n/a
There is a wonderful free library at
http://www.carlosag.net/Tools/ExcelX...r/Default.aspx for doing this
kind of thing. Carlos also has a code generator that will reverse-engineer
the styles of a finished workbook, and yuo can integrate your data code
with. Very nice stuff.

"David" <dm*******@hotmail.com> wrote in message
news:eo****************@TK2MSFTNGP14.phx.gbl...
It looks like this is a very popular subject, but all the previous messages have been deleated from the server. In my application, I need to export a
table in my MSAccess database to an Excel 2003 spreadsheet. I have no
trouble with individual ranges, but am having trouble finding a good example where the data from an entire table is written to the worksheet.

Thanks in advance for any suggestions.

David

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.