Exporting Query to Excel: specifically formulas

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
Back
Top