I know it's fairly easy to export an object such as a table or query to excel, but is it possible to export to a pre-defined destination excel table? I have a query in Access which I would like to export to an Excel spreadsheet which I have already set up with various formulas. In other words, I would like to populate the spreadsheet automatically with the contents of the Access query (hope that makes sense!)
Any suggestions or advice would be much appreciated.
Thanks - I just checked that out, but couldn't really see exactly what I was looking for. I get a bit nervous around modules and vb code and stuff like that as I don't fully understand what's going on with it and how it works! As I said, I'd like to be able to squirt the data from a query straight into a spreadsheet which already has formulas in it.
I get a bit nervous around modules and vb code and stuff like that as I don't fully understand what's going on with it and how it works!
You will struggle a bit then trying to do relatively complex stuff if you aren't prepared to get your boots wet!
Start with the most basic export and ignore the rest. Read up before hand on debugging and stepping through code - go through a line at a time as it executes and move on as you figure out what each line does.
The key process is populate a recordset, set a reference to an excel workbook and use the ... umm.... I've forgotten the name - PopulateFromRecordset method.
LOL! Hope my boots haven't got any holes in them! OK I'll give it a go and see how I get on - I always prefer to work things out myself if I can as it sticks in the brain better that way, but sometimes when I'm against a deadline I have to look for a shortcut. Does the PopulateFromRecordset method (presumably part of the vb code) go on the Access side or the Excel side? In other words, are we "Exporting to" Excel from Access, or "Importing from" Access to Excel? And does it matter? (Or even make sense)