S
sebastico
I'm tryin to export a table to excel with the code:
Private Sub Command4_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
stDocName = "F01_UT"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, F01_UT,
"C:\TRY\Tbls", True
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
However, Access displays the message:
Compile error :
Syntax error
What I'm doing wrong? If I want to export more tablas do I have to write
more lines (DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9) for
each table.
Many thanks
Private Sub Command4_Click()
On Error GoTo Err_Command0_Click
Dim stDocName As String
stDocName = "F01_UT"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, F01_UT,
"C:\TRY\Tbls", True
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
However, Access displays the message:
Compile error :
Syntax error
What I'm doing wrong? If I want to export more tablas do I have to write
more lines (DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9) for
each table.
Many thanks