Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pop ups after saving to csv via macro
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? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
pop ups after saving to csv via macro
Try
ActiveWorkbook.Close SaveChanges:=True That should do it. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
pop ups after saving to csv via macro
if you use the following snippet of code it will switch off most of the
prompts. Application.DisplayAlerts=False "Jonathan" wrote in message ... 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? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
pop ups after saving to csv via macro
Actually, since the workbook has just been saved
ActiveWorkbook.Close SaveChanges:=False my be a better choice. -- Regards, Tom Ogilvy [Wizard] wrote in message ... Try ActiveWorkbook.Close SaveChanges:=True That should do it. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Saving Macro | Excel Discussion (Misc queries) | |||
Help with saving a Macro | Excel Worksheet Functions | |||
Saving a macro | New Users to Excel | |||
Saving with Macro | Excel Discussion (Misc queries) | |||
Saving without Macro | Excel Discussion (Misc queries) |