|
-
Feb 8th, 2006, 04:36 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Set Default Output (Access 97)
Hi all,
I have a feeling that I know the answer to this already, but I'd like to confirm -
Currently, when outputting tables to Excel, my version of Access outputs to Excel 5.0. This means I receive an error every time I try to output a table with over 16k rows. Is there anyway to set the database so that it default outputs to 97/2000 format?
Thanks
Last edited by MethadoneBoy; Feb 15th, 2006 at 05:15 AM.
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Feb 8th, 2006, 07:20 AM
#2
Re: Set Default Output (Access 97)
How are you currently doing it?
-
Feb 10th, 2006, 07:06 AM
#3
Thread Starter
Addicted Member
Re: Set Default Output (Access 97)
To export, I merely click the "Office Links -> Analyze it with MS Excel" icon on the toolbar. Presumably because it's Access 97 that I'm using, it's automatically set to output to the 97 Excel format?
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Feb 10th, 2006, 07:16 AM
#4
Re: Set Default Output (Access 97)
Yep, when writing Access 97 they obviously didn't know about the file format of future versions of Excel.
As you have Access 97 I presume you only have Excel 97 too, is this the case? If so, you cant use Excel Automation to help.
You could theoretically use ADO, but I'm not sure how you would create the document to add the data to.
Another option would be to export to a CSV file, which Excel will happily open.
-
Feb 10th, 2006, 12:03 PM
#5
Thread Starter
Addicted Member
Re: Set Default Output (Access 97)
Well, actually we've got Excel 2003 here in the company. It's just Access that's a leftover from the Office 97 days.
We were initally outputting into a csv file, but were just wondering if there was another way around it.
Thanks for the help, all the same!
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
-
Feb 10th, 2006, 12:33 PM
#6
Re: Set Default Output (Access 97)
If you add a reference to Excel in your access db VBA IDE you can write some code to export to Excel. You can also use late binding so it can support various versions of Excel.
There is a .CopyFromRecordset method that you can use with the EOM to perform the export quite simply.
VB Code:
Option Explicit
'Add reference to Excel xx.0 Object Model
'Add reference to MS ActiveX Data Object 2.x Library
Private Sub Export2Excel()
Dim oApp As Excel.Application
Dim ws As Excel.Worksheet
Dim iCol As Integer
Dim rs As ADODB.Recordset
'Create rs object
'Blah, blah, blah...
Set oApp = New Excel.Application
Set ws = oApp.Sheets("Sheet1")
For iCols = 0 To rs.Fields.Count - 1
ws.Cells(1, iCols + 1).Value = rs.Fields(iCols).Name
Next
ws.Range(ws.Cells(1, 1), ws.Cells(1, rs.Fields.Count)).Font.Bold = True
ws.Range("A2").CopyFromRecordset rs
rs.Close
Set rs = Nothing
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 15th, 2006, 05:16 AM
#7
Thread Starter
Addicted Member
Re: [RESOLVED] Set Default Output (Access 97)
Thanks, RobDog!
EDIT - We've got around the issue by reverting the process so we can just send a CSV file. Thanks to anyone who contributed.
"'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|