Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default pop ups after saving to csv via macro

Try

ActiveWorkbook.Close SaveChanges:=True

That should do it.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Macro whatzzup Excel Discussion (Misc queries) 2 April 24th 08 09:22 AM
Help with saving a Macro Keepsmiling1228 Excel Worksheet Functions 1 April 2nd 08 12:31 AM
Saving a macro Bill New Users to Excel 1 July 12th 07 08:53 AM
Saving with Macro mabbutt Excel Discussion (Misc queries) 2 May 11th 06 03:39 PM
Saving without Macro mrbalaje Excel Discussion (Misc queries) 0 May 6th 05 11:41 AM


All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"