Copying Query into Excel spreadsheet

A

Adam

Hi,

Trying to create a macro which is triggered after the user presses an
"update" button. The macro is to copy the data from a query
(qryPlanesDisplay) and paste the data onto fixed point on a datasheet
template (i.e. paste on A6). Data paste should be data only. Datasheet will
be stored for example in "My Documents" folder on desktop.

When another user does the same function after "updating" some information,
the macro should perform the same function and overwrite the existing
spreadsheet without being asked to overwrite.

Can this be done? Please help. Thanks in advance.
 
K

Ken Snell [MVP]

See these articles for examples of doing what you seek.

Write Data From a Recordset into an EXCEL Worksheet using Automation (VBA)
http://www.accessmvp.com/KDSnell/EXCEL_Export.htm#WriteRstFile


Write Data From a Recordset into an EXCEL Worksheet using EXCEL's
CopyFromRecordset (VBA)
http://www.accessmvp.com/KDSnell/EXCEL_Export.htm#ExpCopyFromRst


Using the Range Argument of TransferSpreadsheet when Exporting Data to an
EXCEL File (VBA)
http://www.accessmvp.com/KDSnell/EXCEL_Export.htm#ExpRange
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top