# Solved: CSV file not saving correctly



## ChrisCawley (Sep 16, 2010)

Hello guys i have returned. Here at work we are using a program that creats a csv file when saved. This program is custom built by a programmer. what i am trying to figure out is was when i view the csv file and run the marco (which is a very basic macro) and save it only to reopen the file to see that the changes that were made were not saved. 

I have attached excel file in which the macro is stored in for all to see.

When i save the file and replace it with the pre existing copy, it gives me a message stating "may contain features that are not compatible with csv (comma Delimted). do you want to keep the workbook in this format?" I click yes but nothing is saved. 

What can i do to have csv save the changes that are made?

Thanks 
Chris


----------



## Jimmy the Hand (Jul 28, 2006)

Chris,

There must be a mistake here. The file you uploaded contains no macro that would hint at a programmer's work. I see only a _recorded_ macro. However, while the macro contains some formatting, sorting and page setup operations, there's no workbook saving function there.
Are you sure you uploaded the right workbook?

Jimmy


----------



## ChrisCawley (Sep 16, 2010)

Hi Jimmy, the programmers code is a whole seperate program which creates the csv files. I am attaching a csv file that has information and the recorded macro that we run when we are finished with the file. 

I am unable to upload the csv file but i was able to save as to xls file. If you would like to see the csv i would prob have to email it. 

As far as the programmers program i am pretty sure that i cannot send it due to legal issues that could arise. 

Please see the attachment and to run the macro ( ctrl q ) is the short cut to it.


----------



## Jimmy the Hand (Jul 28, 2006)

I think I got it now.
So, you open a csv file, do some formatting with a macro, then save the workbook back to the original csv file.
In that case it is no wonder that the formatting is lost. Csv files are purely text. No formulas, no formats, no macros, etc., in short, nothing except plain data is stored in them. 

The only change that should be saved in the csv is the change of order of data rows, because the macro does a data sorting.
Of course, it is only chage in case the data was not sorted originally.
If you want to keep the cell formats, then you must save the workbooks as xls files.

Jimmy


----------



## ChrisCawley (Sep 16, 2010)

Thanks Jimmy for the quick responces. I was thinking the same thing but i thought i would give it a shot. 

Again you guys are great.


----------

