A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

acFormat XLS



 
 
Thread Tools Display Modes
  #1  
Old January 22nd, 2010, 10:13 PM posted to microsoft.public.access
Rose B
external usenet poster
 
Posts: 93
Default acFormat XLS

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?
  #2  
Old January 22nd, 2010, 11:02 PM posted to microsoft.public.access
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default acFormat XLS

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.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Rose B" wrote in message
...
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?



  #3  
Old January 23rd, 2010, 01:04 AM posted to microsoft.public.access
Clifford Bass via AccessMonster.com
external usenet poster
 
Posts: 150
Default acFormat XLS

Hi Rose,

The ability to export a report to Excel gets more limited in new
versions of Access. So you might want to contemplate changing what you are
doing as a means of preparation for the future. Maybe use the DoCmd.
TransferSpreadsheet command instead to transfer the data from the report's
query into Excel.

Clifford Bass

Rose B wrote:
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?


--
Message posted via http://www.accessmonster.com

  #4  
Old January 23rd, 2010, 03:34 AM posted to microsoft.public.access
Albert D. Kallal
external usenet poster
 
Posts: 2,874
Default acFormat XLS


"Rose B" wrote in message
...
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...


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada




  #5  
Old January 23rd, 2010, 09:05 AM posted to microsoft.public.access
Rose B
external usenet poster
 
Posts: 93
Default acFormat XLS

Thanks Albert - that works!

"Albert D. Kallal" wrote:


"Rose B" wrote in message
...
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...


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada




.

  #6  
Old January 23rd, 2010, 09:09 AM posted to microsoft.public.access
Rose B
external usenet poster
 
Posts: 93
Default acFormat XLS

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.

"Arvin Meyer [MVP]" wrote:

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.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Rose B" wrote in message
...
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?



.

  #7  
Old January 23rd, 2010, 09:11 AM posted to microsoft.public.access
Rose B
external usenet poster
 
Posts: 93
Default acFormat XLS

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.

"Clifford Bass via AccessMonster.com" wrote:

Hi Rose,

The ability to export a report to Excel gets more limited in new
versions of Access. So you might want to contemplate changing what you are
doing as a means of preparation for the future. Maybe use the DoCmd.
TransferSpreadsheet command instead to transfer the data from the report's
query into Excel.

Clifford Bass

Rose B wrote:
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?


--
Message posted via http://www.accessmonster.com

.

  #8  
Old January 23rd, 2010, 04:14 PM posted to microsoft.public.access
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default acFormat XLS

"Rose B" wrote in message
...
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.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


  #9  
Old January 24th, 2010, 12:14 AM posted to microsoft.public.access
Clifford Bass via AccessMonster.com
external usenet poster
 
Posts: 150
Default acFormat XLS

Hi Rose,

You are welcome!

Clifford Bass

Rose B wrote:
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.

Hi Rose,

[quoted text clipped - 10 lines]
all works except that the file created is in Excel 95 (I would like 97 -
2003). Is there any way of doing this?


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/201001/1

  #10  
Old January 24th, 2010, 12:16 AM posted to microsoft.public.access
Clifford Bass via AccessMonster.com
external usenet poster
 
Posts: 150
Default acFormat XLS

Hi Albert,

That is pretty intriguing. Thanks for posting it!

Clifford Bass

Albert D. Kallal wrote:
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...


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/201001/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.