Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving files

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Saving files

Dave, Thanks for the help.
-----Original Message-----
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

.

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 Files PennsyNut New Users to Excel 2 December 31st 07 08:21 PM
Saving files colleen Excel Discussion (Misc queries) 1 March 2nd 07 05:52 AM
Help - saving files MSL Excel Worksheet Functions 1 October 28th 06 03:34 PM
Closing files and saving files dan Excel Worksheet Functions 0 August 15th 06 04:07 AM
Saving csv files Steve Excel Discussion (Misc queries) 2 July 20th 05 06:43 PM


All times are GMT +1. The time now is 12:38 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"