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.

XlsIo- open existing XLSM and SaveAs new file

Thread ID:

Created:

Updated:

Platform:

Replies:

127764 Dec 7,2016 01:39 PM Dec 8,2016 07:38 AM ASP.NET Core 1
loading
Tags: XlsIO
Eric Castillo
Asked On December 7, 2016 01:39 PM

I am trying to open an existing XLSM (macro) file, make a small change, then SaveAs a different file. The new file is created and saved but the changes are not reflected, it is like I saved a new copy of the file I opened. What am I doing wrong? I am using full paths, getting no exceptions. It is simply not saving the changes.

FileStream baseInstruction = new FileStream(path, FileMode.Open);
IWorkbook workbook = application.Workbooks.Open(baseInstruction);
IWorksheet worksheet = workbook.Worksheets[0];

worksheet.Range[1, 1].Text = "hello";

FileStream filestream = new FileStream(newPath, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
workbook.SaveAs(filestream);
workbook.Close();
excelEngine.Dispose();


Sridhar Sukumar [Syncfusion]
Replied On December 8, 2016 07:38 AM

Hi Eric, 

 

Thank you for contacting Syncfusion support. 

 

We are unable to reproduce the issue from our side. We have shared a simple sample for your reference which can be downloaded from the following location.  

 

Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/SampleCore-5589288.zip 

 

Kindly modify the sample to reproduce the issue and share us the modified sample along with the issue reproducing input files which will be helpful for us to give you a prompt solution at the earliest. 

 

Please let us know if you have any concerns. 

 

Regards, 

Sridhar S. 


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.

;