D
Damon Heron
I have the following routine that I use to export table data to Excel. The
user selects a name from a combobox (cboTables) and then clicks a cmd
button:
On Error GoTo Err_CmdExport_Click
Dim Path As String
Dim TN As String
Path = Me.txtDirectory
TN = "tbl" & cboTables
DoCmd.TransferSpreadsheet acExport, SpreadsheetType:=8, TableName:=TN,
filename:=Path, Hasfieldnames:=True
exit_CmdExport_Click:
Exit Sub
Err_CmdExport_Click:
If Err <> 2501 Then
MsgBox Err.Description
End If
Resume exit_CmdExport_Click
This works fine for all the tables on the list except for one called
"tblTransactions". Then I get the msg "The Microsoft Jet database engine
could not find the object ". Make sure...."
When I rename tblTransactions to tblTrans it works fine. Then I rename it
again back to tblTransactions and it fails. All of the other tables have
shorter names. Is this some undocumented problem with long names in the
TransferSpreadsheet method? I don't want to have to rename my transactions
table as it is used thru out the db and it would be a pain.
Any ideas are appreciated.
user selects a name from a combobox (cboTables) and then clicks a cmd
button:
On Error GoTo Err_CmdExport_Click
Dim Path As String
Dim TN As String
Path = Me.txtDirectory
TN = "tbl" & cboTables
DoCmd.TransferSpreadsheet acExport, SpreadsheetType:=8, TableName:=TN,
filename:=Path, Hasfieldnames:=True
exit_CmdExport_Click:
Exit Sub
Err_CmdExport_Click:
If Err <> 2501 Then
MsgBox Err.Description
End If
Resume exit_CmdExport_Click
This works fine for all the tables on the list except for one called
"tblTransactions". Then I get the msg "The Microsoft Jet database engine
could not find the object ". Make sure...."
When I rename tblTransactions to tblTrans it works fine. Then I rename it
again back to tblTransactions and it fails. All of the other tables have
shorter names. Is this some undocumented problem with long names in the
TransferSpreadsheet method? I don't want to have to rename my transactions
table as it is used thru out the db and it would be a pain.
Any ideas are appreciated.