Controlling MS Excel 97 from Access 97 (Using VBA)

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

Guest

Hello All

I am in the process of developing a small Access database that pulls data
from linked datasources and pushes it through a report and exports into a MS
Excel 97 spreadsheet. Unfortunately when I use DoCmd.OutputTo none of the
orignal formatting applied to the report is exported with the data. I am
using the following VBA code to do this.

DoCmd.OutputTo acOutputReport, strRPT, acFormatXLS, ReportName & "_" &
strDate & ".xls"

I want to find a way to output this data across to MS Excel and then apply
formatting to the spreadsheet so that it is aesthetically pleasing. Is there
a (non-dodgy) way that I can make this happen?

Thanks!
squirelle
 
hi,
It has been my experience that exporting a access report
to excel is not a good idea. for reasons, excell don't
seem to like the format of access reports.
You might find better result using the
Docmd.tranferspreadsheets method from the access side.
it is not possible to format excel from access.
so you might do what i do which is do it from the excel
side.
write a excel macro that would use microsoft query to pull
the Access query (used as recordsorce for the access
report) in to excel. then add to the macro to do all of
the formatting. the macro could be assing to an icon or
button.
just a suggestion.
regards
Frank
 
Back
Top