Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
SaveAs - VBA | Excel Discussion (Misc queries) | |||
VBA SaveAs Value | Excel Discussion (Misc queries) | |||
SaveAs | Excel Programming | |||
saveas | Excel Programming | |||
SaveAs | Excel Programming |