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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving an Excel File Without Getting Confirmation Box

Status
Not open for further replies.

ctau

IS-IT--Management
Feb 8, 2000
34
US
This is probably a simple task but I just can't figure it out. I have created a procedure that opens an excel file makes some changes and then saves it. But when I try to save it tells me that it already exist and asks me if I would like to continue. Is there a way to avoid this dialog box. The line I am currently using to try to save is xlsApp.Save ("E:\edi SPREADSHEETS\EDI.XLS"). Thanks


CTAU
 
1. If the file does not exist;

xlApp.ActiveWorkbook.SaveAs Filename:="E:\ediSPREADSHEETS\EDI.XLS"

2. If you opened the file, modified it, and want to save the changes;

xlApp.ActiveWorkbook.Save

3. If you created a new file and want to overwrite the existing file then;

Kill("E:\ediSPREADSHEETS\EDI.XLS")
xlApp.ActiveWorkbook.SaveAs Filename:="E:\ediSPREADSHEETS\EDI.XLS"

Hope this helps!
 
Thanks, that did the trick.


CTAU
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top