Hi I am trying to make an excel macro do the following 5 steps: -
1. Run automatically when the excel document is opened, (I have done this bit okay).
2. Delete the contents of a folder (containing a .csv file) without asking any questions to confirm.
3. Make the macro sleep for 20 seconds before moving to the next step.
4. Save the Excel document to a different directory as a different type of file (.csv) I have got this to work.
5. Close the current Excel document without asking any questions like 'Would you like to save the document before closing'.
I have managed to do steps 1 and 4 buy using the following script but can't get any further at the moment, any help would be greatly appreciated.
Thanks
Private Sub Workbook_Open()
ThisWorkbook.SaveAs "k:\upload_script\ftp\fx_rates", xlCSV
End Sub
1. Run automatically when the excel document is opened, (I have done this bit okay).
2. Delete the contents of a folder (containing a .csv file) without asking any questions to confirm.
3. Make the macro sleep for 20 seconds before moving to the next step.
4. Save the Excel document to a different directory as a different type of file (.csv) I have got this to work.
5. Close the current Excel document without asking any questions like 'Would you like to save the document before closing'.
I have managed to do steps 1 and 4 buy using the following script but can't get any further at the moment, any help would be greatly appreciated.
Thanks
Private Sub Workbook_Open()
ThisWorkbook.SaveAs "k:\upload_script\ftp\fx_rates", xlCSV
End Sub