Thread: Saving files
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Saving files

Are you sure you're opening the .csv file the second time?

Try it with a nice unique name--just to verify.

I'm not sure what your macro does, but if you copy the worksheet to a new
workbook, then save that, it might work better for you:

Option Explicit
Sub testme01()
Dim wks As Worksheet
Set wks = Worksheets("sheet1")
wks.Copy 'to a new workbook
With ActiveSheet.Parent
.SaveAs Filename:="whateveryousaveitas.CSV", FileFormat:=xlCSV
.Close savechanges:=False
End With
Workbooks.Open Filename:="whateveryousaveitas.CSV"
End Sub



Cindy wrote:

I have a workbook that has a macro that does a save as
saves a csv file. The problem is that until you close
the file and re-open it, it still has formuals, multiple
worksheets, etc in it. For my purposes, I need the file
to be a true csv file.

Is there a way to do a file save as and close that file
with out closing the current excel file. OR save the
current file as an excel file then save as again as a csv
file then open the excel file and close the csv file.

To complicate it more the file is opened originally as a
read only and I would have to come up with some type of
name for the save.

Any help will be greatly appreciated.

Cindy.


--

Dave Peterson