We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

convert excel to csv using XlsIO

Thread ID:

Created:

Updated:

Platform:

Replies:

117910 Jan 7,2015 02:55 PM Jan 9,2015 02:35 AM ASP.NET Web Forms 3
loading
Tags: XlsIO
minhnj
Asked On January 7, 2015 02:55 PM

hi,

i have a mapping excel file containing external links to other ratesheet files (could be 1 ratesheet file or multiple ratesheet files). The mapping excel may have pivot table in other workbook.
When i open the ratesheet files and mapping file. The mapping files will refresh and pickup new data from ratesheet files.
and then save the mapping excel file to csv file.

Is there a way to accomplish that? I tried, but it does not work.
           
            string rsFile = @"C:\Rates.xls";
            string wsFile = @"C:\Worksheet Franklin.xls";

 ExcelEngine excelEngine = new ExcelEngine();
            
            IWorkbook rs = excelEngine.Excel.Workbooks.Open(@rsFile, ExcelOpenType.Automatic);

            IWorkbook ws = excelEngine.Excel.Workbooks.Open(@wsFile, ExcelOpenType.Automatic);

            ws.ActiveSheetIndex = 0;

            ws.SaveAs(@wsFile.Replace(".xls", ".csv").Replace(".xlsx", ".csv"));

Thanks,
Minh


Ishwarya Narayanan [Syncfusion]
Replied On January 8, 2015 08:26 AM

Hi Minhnj,

 

Thank you for using Syncfusion products.

We have analyzed your query and found that “comma(,) separator argument is missing in your save method.” We have shared the code snippet and sample for your reference. Kindly try the sample at your end and get back to us if the issue is reproducing. If not, please modify the sample to reproduce the issue and get back to us. This will help us to investigate further and provide you a prompt solution. 

Code Snippet:

 

workbook2.SaveAs(inputPath2.Replace(".xls", ".csv").Replace(".xlsx", ".csv"),",");

 

Sample link:

http://www.syncfusion.com/downloads/support/directtrac/general/Forum1179102133420831.zip

 

Refers,

Ishwarya N


minhnj
Replied On January 8, 2015 10:17 AM

hi Ishwarya,

I have it works to saveas csv file, however, it does not update with new data from my mapping file. my mapping file has pivot table in other worksheet. How do i update the external link or refresh the whole workbook to get updated data from ratesheet files?

I want to post my ratesheet file in private, not display to people. Is there an option for it? because i am concerning about the security risk.

Thanks
Minh

Ishwarya Narayanan [Syncfusion]
Replied On January 9, 2015 02:35 AM

Hi Minhnj,

 

We appreciate your patience.

 

It would be grateful for us to investigate on this if you could share us the input template to proceed further on this. We would request you to use our Direct-Trac Support system for further follow up.

Kindly use the below link to login on Direct trac.

 

Direct trac Link:  https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

 

Please let us know if you need any clarification.

 

Regards,

Ishwarya N


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;