acFormat XLS

R

Rose B

I have a custom ribbon for reports, which can be used in Runtime A2K,
including a button that will export the information in the report to Excel -
all works except that the file created is in Excel 95 (I would like 97 -
2003). Is there any way of doing this?
 
A

Arvin Meyer [MVP]

I don't have anything to try this with, but you might try leaving the Format
argument blank in your code. Access should then prompt you. Hopefully,
you'll be able to show it what type of file.
 
A

Albert D. Kallal

Rose B said:
I have a custom ribbon for reports, which can be used in Runtime A2K,
including a button that will export the information in the report to
Excel -
all works except that the file created is in Excel 95 (I would like 97 -
2003). Is there any way of doing this?

If your code is using:

DoCmd.OutputTo acOutputReport, strReport, acFormatXLS, "c:\1.xls"
You could Try

"Excel 97 - Excel 2003 Workbook (*.xls)"
so:

DoCmd.OutputTo acOutputReport, strReport, "Excel 97 - Excel 2003 Workbook
(*.xls)", "c:\1.xls"
The above works in a2010 beta, but see what happnes in 2007. My VPC version
of access 2007 seems to not work for either of the above, so perhaps it will
work for you...
 
R

Rose B

Thanks Albert - that works!

Albert D. Kallal said:
If your code is using:

DoCmd.OutputTo acOutputReport, strReport, acFormatXLS, "c:\1.xls"
You could Try

"Excel 97 - Excel 2003 Workbook (*.xls)"
so:

DoCmd.OutputTo acOutputReport, strReport, "Excel 97 - Excel 2003 Workbook
(*.xls)", "c:\1.xls"
The above works in a2010 beta, but see what happnes in 2007. My VPC version
of access 2007 seems to not work for either of the above, so perhaps it will
work for you...


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)



.
 
R

Rose B

Thanks Arvin, this worked! The response from Albert worked too - and has the
advantage of not asking for the file type (I have different buttons to choose
if the user wishes to export to Word, PDF etc.) but this gives me some
flexibility.
 
R

Rose B

Thanks Clifford. I had played around with the TransferSpreadsheet but in this
particular instance this solution isn't so good for me as the report is also
having filters set depending upon user choices. I will remember this in
future though.
 
A

Arvin Meyer [MVP]

Rose B said:
Thanks Arvin, this worked! The response from Albert worked too - and has
the
advantage of not asking for the file type (I have different buttons to
choose
if the user wishes to export to Word, PDF etc.) but this gives me some
flexibility.

Great! Remember that each version will never know about future versions, and
historically, Microsoft codes conservatively to connect to as much data as
possible. One cannot guarantee, however, that these solutions will work in
the next version. That said, they usually do, and generally only require a
minor update if they don't.
 

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