Interger for constant acFormatXLS

G

Guest

Hi,

I'm using Docmd.Sendobject but I'm passing all of my parameter values from a
table. I'm getting the following error message:

Error 2282 - format not available

Someone suggested that I use the integer value for the Send Type and Send
Format. For the Send Type parameter I was able to find the integer
equivalent of acSendQuery: 1.
I’m having trouble finding the integer equivalent for acFormatXLS, and when
I pass the literal text value, that’s when I get the error. When I hard code
the text value (see below code) I don’t receive an error.

DoCmd.SendObject olSendType, olRptNm, acFormatXLS, olTo, olCC, olBcc,
olSubject, olBody, -1

I need to pass the parameter values from a table because the values are
different based on the object I’m emailing, and I didn’t want to have to code
multiple DoCmd.SendObject statements.

Any help would be appreciated!!

Thanks,
Manuel
 
P

pietlinden

Hi,

I'm using Docmd.Sendobject but I'm passing all of my parameter values from a
table. I'm getting the following error message:

Error 2282 - format not available

Someone suggested that I use the integer value for the Send Type and Send
Format. For the Send Type parameter I was able to find the integer
equivalent of acSendQuery: 1.
I'm having trouble finding the integer equivalent for acFormatXLS, and when
I pass the literal text value, that's when I get the error. When I hard code
the text value (see below code) I don't receive an error.

DoCmd.SendObject olSendType, olRptNm, acFormatXLS, olTo, olCC, olBcc,
olSubject, olBody, -1

I need to pass the parameter values from a table because the values are
different based on the object I'm emailing, and I didn't want to have to code
multiple DoCmd.SendObject statements.

Any help would be appreciated!!

Thanks,
Manuel

looks like it's a string....

?acformatxls
Microsoft Excel (*.xls)
 
G

Guest

If you use the object browser to lookup 'acApplyFilter' you'll get

Const acApplyFilter = 1

where you can replace the acApplyFilter by 1 as an input variable. However,
in the case of 'acFormatXLS' you get

Const acFormatXLS = "Microsoft Excel (*.xls)"

it does not have an integer replacement. You can use Const acFormatXLS or
"Microsoft Excel (*.xls)".
--
Hope this helps,

Daniel P
 
G

Guest

Note that the export format is actually BIF. This is an
open format for spreadsheets. Excel opens files in this
format without comment, but Access can't re-import files
that are sent this way.
 

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