I Need to send 5 access reports to Excel and know how to do this using tools office links or file save as export. I would like to have anyone in the office be able to have a macro or code to do this.
Thank you!
Bob Woods
One way, you can use the "OutputTo" or "TransferSpreadsheet" functions of the "Docmd" object. I would look these items up in the Access Help.
The simplest way to do it is use a macro.. I don't use them much myself as they don't offer versatility, unlike code, though they do offer one benefit - if you are not confident with code, then they make it very easy and can later be converted to code to assist in the learning process.
Goto the macros tab and select the action 'OutputTo'. This will then enable you to select the type of object you want to output - Table/Query/Report/Form etc and what the name of it is in your db. You can then specify which type of output you want - text file, spreadsheet etc etc.. and finally the name / path. There are options to automatically start the application with the document you have just exported if you want. Do this for the 5 reports you want to export and hey presto!
This should do what you want, though if you want to use this in code and dynamically name the file etc then use the convert macros to code option in the tools menu when in the database window view.
One final thing; try using a query instead of a report to output to excel - it is much easier for the users to manipulate - reports can have lots of nasty formatting which can make it difficult to work with in excel.
Damian
damber@damber.net
A smile is worth a thousand kind words. So smile, it's easy!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.