acFormatXLS Works in 2003 not 2007

  • Thread starter Thread starter Kelly
  • Start date Start date
K

Kelly

I have a db system with an option to send a report as an Excel spreadsheet
attachment to an email; been working like a champ for the last few years. Our
office staff upgraded to MS Office 2007 and now an error message comes up at
that line and the command fails. Interestingly, just for fun I changed the
format variable from acFormatXLS to acFormatRTF and it worked just fine. Any
clues? Help is much appreciated.

The code:
DoCmd.SendObject acSendReport, stDocName, acFormatXLS, strEmail, , ,
strSubjectLine, strMessage, True

The error message:
The format in which you are attempting to output the current object is not
available.
 
Well, I found my own answer in the MSDN boards. For whatever reason it is by
design, MS has taken out the ability to export a report in Excel format. I
exported the query instead and hope the client is happy without the report
headings and such.
 
Back
Top