Problem creating CSV File

mzzyyy

New Member
Joined
Apr 19, 2016
Messages
3
Hi all,

I am new to VBA and I am stuck in this issue for the last 2 days :( Please suggest me some solution. I am trying to create csv file from excel file. The file gets created but all the columns merge into just one column. :( i.e its not comma separated.
The piece of code I am using for creating the csv is below :-
wkb.SaveAs FileName:="C:\Users\Public\EGM.csv", _
FileFormat:=xlCSV, CreateBackup:=False
wkb.Close savechanges:=False


Can anyone help me with this?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to the Board!

Seeing as this appears to be an Excel question and not an Access one, I moved it from the Access forum to the Excel forum.
CSV files are text files, and therefore really do not have "columns". Each field is just separated by a comma.
What program are you using to view the CSV file after it has been created?
If you take a look at in NotePad or WordPad, they should see it exactly as it really is.
If you open it in Excel, some conversions may be done to it, and it may not be a true representation of what you really have.
 
Upvote 0
Thanks Joe4. I am trying to open it by just double clicking it and it shows all the data in one column without any comma separation. I opened the file with notepad and there is not comma in it.
 
Upvote 0
What does the data look like in Excel before you try saving it as a CSV file?
 
Upvote 0
Is there a way I can attach the screenshot here? The "insert Image" link does not insert the image but a link to the content.
The data in excel is saved in multiple columns i.e 10 columns, I am copying the data , creating a new CSV pasting excel data to the CSV File and adding 2 new columns to it.
 
Upvote 0
The other option is to upload the file to a file share site, and provide a link to it here.
We usually like to save that as a last resort, as many people have limitations on downloading files from the internet due to security concerns.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top