LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default SaveAs Issues

Here is my macro, pulled from elsewhere in this discussion group:

Sub saveascsv()

Dim SaveName
SaveName = ThisWorkbook.Path & "\CSV Output.csv"

Worksheets("Summary").Activate
Worksheets.Copy
Workbooks(Workbooks.Count).Activate
Workbooks(Workbooks.Count).SaveAs SaveName, xlCSV,
ConflictResolution:=xlLocalSessionChanges
Workbooks(Workbooks.Count).Close SaveChanges:=False

End Sub

My questions:
1. How do I "trap" the error whenever a prior version of "CSV Output" is
open? I'm thinking of a user msg such as "Please close CSV Ouput and try
again" with a Retry button.
2. How do I avoid the user being asked if s/he wants to overwrite an
existing version of the file? In this particular application, it is never
wrong to do so. The above code doesn't work.

Many thanks.
 
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
SaveAs - VBA Jae Excel Discussion (Misc queries) 0 April 10th 08 06:04 AM
VBA SaveAs Value charlie Excel Discussion (Misc queries) 4 August 27th 07 11:33 PM
SaveAs Duncan[_6_] Excel Programming 1 June 15th 06 09:52 AM
saveas Nikita Excel Programming 1 September 17th 03 02:39 AM
SaveAs Darrin Henry Excel Programming 0 September 12th 03 10:09 PM


All times are GMT +1. The time now is 09:55 PM.

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

About Us

"It's about Microsoft Excel"