borderAndreaVB free resources for Visual Basic developersborder

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

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

Print This Topic
Previous Topic (Need to copy values from other documents based on heading name and create a new document through VBA)Next Topic ([b]Help using RichtextCtrl in Access 2003[/b]) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : export ms access to ms excel sheet
Poster Message
kckoshy
Level: Graduate

Registered: 12-09-2006
Posts: 9

icon export ms access to ms excel sheet

Hello,
I wish to export an MS Acess table to M S Excel sheet during run time. the name of the excel sheet shall be given by the user during the run time.
can anybody help to write the code .

thanks
kck

____________________________
kck

12-09-2006 at 05:15 AM
View Profile Send Email to User Show All Posts | Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1156
icon Re: export ms access to ms excel sheet

Hi

Heres a function to export your table to an excel file.

Public Function ExportToExcel()

    DoCmd.OutputTo acOutputTable, "YOURTABLE", acFormatXLS, "YOUREXCELFILENAME"
    
End Function



Steve

12-09-2006 at 02:15 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : export ms access to ms excel sheet
Previous Topic (Need to copy values from other documents based on heading name and create a new document through VBA)Next Topic ([b]Help using RichtextCtrl in Access 2003[/b]) 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-2007 Andrea Tincaniborder