Forum Discussion
Multiple issues with saving .xlsx file as a .csv
superbeau wrote:I click "Save As", select ".csv", enter a file name and location, and click "Save". The system pops up a new Excel window with the newly created CSV file
This doesn't happen on my system.
And you don't open csv with Excel but import csv into Excel - either the legacy way or the Power Query way.
Check the csv content with a text editor. Does it show leading zeros?
- superbeauOct 09, 2020Copper Contributor
Detlef_Lewin yes, if I open the .csv file in Notepad, the leading zeros are there. So I guess I should just plan to Save As a .csv file and then not open that file again with Excel. But I wonder why then Excel opens the newly formed .csv file automatically in an Excel window right after you create it? And why does that file look correct, but if you close and reopen, it gets messed up?
- Detlef_LewinOct 09, 2020Silver Contributor
superbeau wrote:But I wonder why then Excel opens the newly formed .csv file automatically in an Excel window right after you create it?
I have no idea. It does not happen on my system.
- superbeauOct 09, 2020Copper Contributor
Also, I should have mentioned that I use Office 365, so I have the latest version of Excel running in Windows 10 Pro (64 bit) on a Surface Book laptop.
- SergeiBaklanOct 09, 2020Diamond Contributor
To create separate csv files for each worksheet you may use powershell , sample is here Convert Excel file (XLSX) to CSV in Powershell , or similar VBA script, or manually: right click on sheet, Move or Copy, check Copy, from destination select new book and from it save as csv. Content will be in Excel window since that's default application for csv files. Modern Excel save all csv sheets into the file if Save As.
If close and open csv file in Excel again it performs default conversions, that was for all versions. In particular, numbers saved as texts will be converted back to numbers (but not only, there are another conversions). I don't know about workaround, the only not to open in Excel but import to Excel using legacy wizard or Power Query. In both cases mark proper columns as having Text type.