borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2011 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (Share .net book for FREE!!!) New Topic New Poll Post Reply
AndreaVB Forum : ASP.Net : Export to Excel
Poster Message
revned
Level: Trainee

Registered: 27-10-2008
Posts: 1

icon Export to Excel

I have a form in a subform, i have a command button
cmdExportExcel..

i want this cmdExportExcel export the filtered data in my subform to excel.is it possible in access 2003?
can anyone help me how can i write my vba codes for my cmdExportExcel.

thanks

revned

27-10-2008 at 08:17 AM
View Profile Send Email to User Show All Posts | Quote Reply
Daisy09
Level: Trainee

Registered: 15-02-2011
Posts: 2
icon Re: Export to Excel

I want to introduce you one article. I read it and think that it will be helpful for you to solve the problem.
You can read it on
http://janewdaisy.wordpress.com/2011/02/25/fast-export-data-from-database-to-excel-and-generate-chart-without-automation/

[Edited by Daisy09 on 02-03-2011 at 03:17 AM GMT]

02-03-2011 at 03:16 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 607
icon Re: Export to Excel

Access has a built in function for this. - DoCmd.OutputTo
You can use this function to output most objects from Access, including Queries, to most formats used in the main Microsoft Office products - i.e. Word and Excel.
So, if your subform is based on data from a Query then all you need to type in your vba code is:-

DoCmd.OutputTo acOutputQuery, "Query1", acFormatXLS, "C:\tmp.xls", False

If you highlight the OutputTo and hit F1 then Help will give you more detail.




____________________________
multi-tasking - the ability to hang more than one app. at the same time.

07-03-2011 at 12:12 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : ASP.Net : Export to Excel
Next Topic (Share .net book for FREE!!!) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2011 Andrea Tincaniborder