Run Time Error 3190..on exporting a 17x50 table (1 Viewer)

alktrigger

Aimless Extraordinaire
Local time
Today, 06:18
Joined
Jun 9, 2009
Messages
124
I'm attempting to export a table that is compiled via queries to be used as a report. The table has 17 fields, and only holds 50 records(+/-5). When I run export code it gives me the 3190 error : "Too many fields defined". The error occurs right after the section of code in red.

Code:
    strTable = "tblReport"
    
    [COLOR=SeaGreen]'Create worksheet save name:[/COLOR]
    strWorksheetPath = "C:\" 
    strWorksheet = "DS_Weekly"
    strSaveName = strWorksheetPath & strWorksheet & ".xls"
    
    Debug.Print "Worksheet; Save; Name; " & strSaveName; ""
    On Error Resume Next
    
  [COLOR=SeaGreen]  'Delete existing worksheet (if there is one):[/COLOR]
Kill strSaveName
    
On Error GoTo ErrorHandler

[COLOR=SeaGreen]'Export query data to a new worksheet in Excel 9 format:[/COLOR]
[COLOR=Red]DoCmd.TransferSpreadsheet transfertype:=acExport,_ 
        spreadsheettype:=acSpreadsheetTypeExcel8,_ 
        TableName:=strTable, FileName:=strSaveName, _ 
        Hasfieldnames:=True[/COLOR]
This was a direct transfer from another prototype of this DB and used to work flawlessly. Any suggestions?

Edit: sorry for the spam
 
Last edited:

DCrake

Remembered
Local time
Today, 11:18
Joined
Jun 8, 2005
Messages
8,626
Are you using a different version of Access/Excel?
Have you tried to do it though a macro?
Have you tried to do it manually through the menus?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 11:18
Joined
Sep 12, 2006
Messages
15,755
acSpreadsheetTypeExcel8

what is an excel8 spreadsheet. I would normally use a different version. so perhaps its that?

why not compile the transferspreadsheet statement manually, and select/try different options for each argument.
 

Users who are viewing this thread

Top Bottom