Click here to Skip to main content
14,921,505 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
oWB.SaveAs(Filename:="C:\target\Testxls", FileFormat:=Excel.XlFileFormat.xlCSV)

This is how I save the Excel file I created, but when I checked the file, the formatting is ruined? :(

How can I avoid it?

Updated 7-Mar-12 22:49pm

1 solution

You are specifying Comma Separated Value format in the SaveAs method. This format cannot store the format information of excel file. You can choose one of the formats, which suits your requirement, from the list given here[^]
Maciej Los 8-Mar-12 8:19am
My 5! Very good and short answer!
ProEnggSoft 8-Mar-12 8:33am
Thank you Iosmac
Alan Tuscano 8-Mar-12 19:26pm
Thanks ProEnggSoft, It Worked! :)
Also, my 5 to u.
ProEnggSoft 8-Mar-12 19:33pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900