Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 Excel Macro help

Status
Not open for further replies.

MZiggy

IS-IT--Management
Feb 18, 2002
13
0
0
IE
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
 
I suppose you are looking for the line

Application.DisplayAlerts = False

You need to put the line

Application.DisplayAlerts = True

after saving the document. If you forget the last line, even in direct mode the question if you want to save changes or not won't popup anymore.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top