Exporting Query to Excel: specifically formulas

P

pepenacho

Hello:

Case: If I build a dbase with, i.e. financial information, in access and use
a query to output information to Excel:

1) I know I can link from Excel to query and pull the data.

2) But can I pull the data in such a way where, in columns that use a
calculation, the calculation iteself (and not the hard value) is populated
into Excel?

Thanks,
pepenacho
 
K

Klatuu

It can be done, but it will require yo to use Automation. That is, you will
have to open the spreadsheet as an Excel object in Access. To put in the
results of your query, you can use the CopyFromRecordset method. Then, you
can use Excel commands from within Access to insert the formula. Something
like:
XlObj.xlWorksheet.Cells(50,25).Formula = "=Sum(B2:B59)
 

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