how to export msaccess table to msexcel sheet using visual basic?
hello friends,
I have developed a software in visual basic 6 with ms access 2000 database. I have used odbc to link the database. Often I have to close the program and open the database through ms access and export the table to ms excel.
Please help me to write the proper code in visual basic so as to export the msaccess table to ms excel sheet during run time. The name of the the ms excel sheet should be accepted as given by the user.
This supersedes my earlier request for the same subject.
Re: how to export msaccess table to msexcel sheet using visual basic?
quote:kckoshy wrote:
hello friends,
I have developed a software in visual basic 6 with ms access 2000 database. I have used odbc to link the database. Often I have to close the program and open the database through ms access and export the table to ms excel.
Please help me to write the proper code in visual basic so as to export the msaccess table to ms excel sheet during run time. The name of the the ms excel sheet should be accepted as given by the user.
This supersedes my earlier request for the same subject.
bye
kck
One thing can be done as i use with my clients
make a link table in access with Excel Sheet
in Excel Sheet first row type all fields name and save that sheet with your known name
now link that excel file in your access database
this will react as a table but anything you write here will automatically updated in excel sheet
Now send any command/action from your vb app and records to this excel table
by programming copy excel file to user path and rename there as per user required name or ask user to enter name of that file and rename by that and show excel file to your user.
i hope this can solve your problem, but as you know this required a prototype for that excel file as you mention in your access file. if link file not available the n function will not work.