hi
i have a sub that exports all tables into an excel spreadsheet, is there any way i can automate this for a specific time of day?
here is my code
i have a sub that exports all tables into an excel spreadsheet, is there any way i can automate this for a specific time of day?
here is my code
Code:
Private Sub btnExportDatabase_Click()
Dim td As DAO.TableDef, db As DAO.Database
Dim out_file As String
out_file = "S:\Systems Eng\Rolling Stock\MCU\BACKEND DATABASE DO NOT TOUCH" & "\KADBEBackUp" & Format(Date, "ddmmyyy") & ".xls"
Set db = CurrentDb()
For Each td In db.TableDefs
If Left(td.Name, 4) = "MSys" Then
'// do nothing -- skip
Else
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
td.Name, out_file, True, Replace(td.Name, "dbo_", "")
End If
Next
End Sub