Hi
Code for export Qeury ,Report or Table In Access Database to Excel File
I need this code
I have this
Code:
On Error GoTo Err_ToExcel_Click
Dim stDocName As String
Dim theFilePath As String
stDocName = "AliElbasry"
'DoCmd.OpenQuery stDocName
theFilePath = Application.CurrentProject.Path
theFilePath = theFilePath & stDocName & ""
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, stDocName, theFilePath, True
Exit_ToExcel_Click:
Exit Sub
Err_ToExcel_Click:
MsgBox "Error"
Resume Exit_ToExcel_Click
End Sub
I need the code when I click appear some Dialog box to chosse the Path to save the file