Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 7th, 2006, 10:38 PM
Authorized User
 
Join Date: Sep 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Export version

Hey everyone, i am still a beginner using VBA and i have a problem

when i export a table to excel it saves it as a 5.0/95 Workbook
is there anyway to make it output as the current version?

this is my code:

Function funcExport(strTableName, strFileName As String)
On Error GoTo funcExport_Err

    ' Exports list to file
       DoCmd.OutputTo acTable,strTableName, "MicrosoftExcel*.xls)", _
        strFileName, False, "", 0


funcExport_Exit:
    Exit Function

funcExport_Err:
    MsgBox Error$
    Resume funcExport_Exit

End Function

I have also tried "MicrosoftBiff8(*.xls)"

any help would be much appreciated

 
Old September 8th, 2006, 06:39 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Try this:

DoCmd.OutputTo acOutputTable, strTableName, acFormatXLS, strFileName

False is the default for AutoStart, so not needed.
Likewise for TemplateFile and Encoding


This should use the version of Office installed on the PC.

Did this help?


mmcdonal
 
Old September 10th, 2006, 06:03 PM
Authorized User
 
Join Date: Sep 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks heaps for the reply, but it doesn't seem to be working
... i mean it all works fine but is still outputting as a 5.0/95 workbook....

would it have anything to do with the file name?



 
Old September 11th, 2006, 06:19 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What version of Excel do you have installed on the machine, and what version of Access?


mmcdonal
 
Old September 11th, 2006, 05:51 PM
Authorized User
 
Join Date: Sep 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Both 2002






Similar Threads
Thread Thread Starter Forum Replies Last Post
Oh! Another Version mike_remember ASP.NET 3.5 Basics 3 September 18th, 2007 09:51 AM
Passwords from version 1 to version 2 Maxxim BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 February 6th, 2007 06:49 PM
Which version UNCLEBENZ Visual C++ 1 November 2nd, 2005 05:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.