pop ups after saving to csv via macro

  • Thread starter Thread starter Jonathan
  • Start date Start date
J

Jonathan

I have the following simple macro to take data from an
excel sheet (which updates from DDE links) and save it as
a csv file. the problem is after I run it i get the
message:

"Do you want to save the changes you made to 'Daily
Updates.csv'? - to which I have to manually select yes
and then file closes. how do i get around this? Code
below:

Sub Create_CSV()
'
' Create_CSV Macro
'

'
Kill "C:\Data Updates\CSV\Daily Updates.csv"
ActiveWorkbook.Save
Sheets("DailyFeeder").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Data Updates\CSV\Daily Updates.csv", _
FileFormat:=xlCSV, CreateBackup:=False
ActiveWorkbook.Close


End Sub


P.S. when i open the excel file, it takes a minute or two
for the dde links to update. any way to put code in
another macro to open the file, let it wait 2 minutes and
then execute the above macro?
 
if you use the following snippet of code it will switch off most of the
prompts.


Application.DisplayAlerts=False
 
Actually, since the workbook has just been saved

ActiveWorkbook.Close SaveChanges:=False

my be a better choice.
 
Back
Top