View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joannele71 joannele71 is offline
external usenet poster
 
Posts: 6
Default SaveAs problem in Excel VBA script

Hi

I have the following macro to save the Index sheet as a new workbook "abc"
in csv format. Since I have the abc.csv file in the c:\ directory, Excel
will ask me whether I want to overwrite the file. So I have the
application.sendkeys to say Yes to overwrite. This works fine if I am
running it manually but the macro stops at the overwrite question if I
scheduled the macro to run. Then I have to hit yes and the macro finishes it
up. Do you know how I can fix this issue? Thank you in advance.

Joanne

Sheets("Index").Select
Sheets("Index").Copy

Application.SendKeys ("Y~")

ActiveWorkbook.SaveAs Filename:="c:\abc.csv", _
FileFormat:=xlCSV, CreateBackup:=False

ActiveWindow.Close