Access 2007 and SendObject

R

Ron P

I have an issue and I hope someone can point me in the right direction.
Corporate head quarters has started pushing out Office 2007, we have a
database created in Access 2003. We use this Access 2003 database on a daily
basis, and on the computers that have Access2007 installed the Send Object
command has stopped working. the code is

DoCmd.SendObject acReport, "workorder",
"MicrosoftExcelBiff8(*.xls)",emailaddress,,"","Workorder","message", False

Someone said removing the (*.xls) would work but it does not. The error
states "The format in which you are attempting to output the current object
is not available."

Here's the other thing beside not all pc's having Access 2007, the people
that are getting this work order do not have Office 2007 and will not be
getting it anytime soon and they need to continue getting the workorder in
Excel format. Everything was working fine with 2003. Anyone have any ideas
since corporate is pushing for the office 2007 upgrade?
 
D

Dale Fye

Ron,

You could use the Version property of the Application object to determine
which version of Access is being run, then use the appropriate format.
Something like:

Dim strOutputFormat as string
strOutputFormat = IIF(Application.Version = "12.0", acformatXLS,
"MicrosoftExcelBiff8(*.xls)")
docmd.sendobject acSendReport, strReportName, strOutputFormat
 

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