Hi,
I want to run a macro that from a desktop icon
- deletes existing files
- writes in the replacements
- closes access
The macro runs fine on its own, but I have to convert to VB to add the kill function. I get asked for macro name when I run this. Any ideas?
Option Compare Database
'------------------------------------------------------------
' Loading_schedules
'
'------------------------------------------------------------
Function Loading_schedules()
On Error GoTo Loading_schedules_Err
Kill "\\filepath
Kill "\\filepath
DoCmd.OutputTo acOutputQuery, "Loading Patterns", "ExcelWorkbook(*.xlsx)", "filepath", False, "", , acExportQualityPrint
DoCmd.OutputTo acOutputQuery, "PAD Schedule", "ExcelWorkbook(*.xlsx)", "\\filepath", False, "", , acExportQualityPrint
DoCmd.Quit acExit
Loading_schedules_Exit:
Exit Function
Loading_schedules_Err:
MsgBox Error$
Resume Loading_schedules_Exit
End Function