Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Jan 27, 2022 5:29 pm

Hi,

I followed the code proposed by your colleague rachel.lei in this discussion post45279.html#p45279

The code is working well for the search Regex and replace data, but when I try to save the new Excel file, the excel file is not containing my new replacement value, but still the old one. It's like the replace is not take in consideration before saving.

I'm using the exact same code snippet on the link above.

Can you please help on it ?

Thanks a lot.
Best

alvesmarc
 
Posts: 8
Joined: Wed Jan 05, 2022 8:00 pm

Fri Jan 28, 2022 2:22 am

Hello,

Thank you for your inquiry.
I tested the code you mentioned with FreeSpire.Office V4.3.1 and the latest version (Spire.Office Platinum Version:7.1), but none of them reproduced the issue you mentioned. For your situation,I suggest you first try again with the latest version(Spire.Office Platinum Version:7.1). If the issue still exists after trying, please provide the following information for our reference. Thanks in advance.
1) Your input Excel file (you could attach it here or send it to us via email (support@e-iceblue.com)).
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
3) Your application type, such as Console app.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1650
Joined: Wed Apr 07, 2021 2:50 am

Fri Feb 04, 2022 4:25 pm

Hello,

After a lot of testing, I found the situation. The point is that the Excel file is download from a web site. And then, our process that uses Spire.XLS tries to replace some word into it.
When we are trying to run it directly on the downloaded file, without any other action on file, means without opening it before (manually by a user) we have the problematic behavior explained on this thread.
But, if we open the Excel file and for example save it, and then try again to run our Spire process, it works. The replacement is done!

With these elements, I thought that it's because the Excel is in Protected Mode when downloading from the original website, that's the case in fact, when we open the file for the first time we can see that it's in Protected Mode, maybe that's why Spire cannot work on it...
So I tried to use the unprotect function that is coming with Spire but it still not working, for the replacement of values.

Do you have any idea ?

Thx
Best,

alvesmarc
 
Posts: 8
Joined: Wed Jan 05, 2022 8:00 pm

Mon Feb 07, 2022 2:28 am

Hello,

Thanks for your feedback.
In order to help us solve your issue quickly and efficiently, please provide the following information. Thanks in advance.
1) Your Excel file in protected mode (you could attach it here or send it to us via email (support@e-iceblue.com)).
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).
3) Your application type, such as Console app (. Net Framework 4.5).

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1650
Joined: Wed Apr 07, 2021 2:50 am

Mon Feb 07, 2022 4:02 pm

Sure, thanks for your help. I sent the file by email.
My env is Win 10 x64 and region is France.
My app is WinForm .NET 5.0
FreeSpire.Office 4.3.1.

Thanks again.
Best

alvesmarc
 
Posts: 8
Joined: Wed Jan 05, 2022 8:00 pm

Tue Feb 08, 2022 2:29 am

Hello,

Thank you for your sharing.
I tested your Excel file in the same environment with the same settings as you, and found that the FreeSpire.Office 4.3.1 does have the issue you mentioned, but the commercial version fixes this issue. Since we only maintain the free version irregularly. I suggest that you use our commercial version (the latest version is Spire.Office Platinum Version:7.1 ), which contains more fixes and new features than the free one. We are willing to provide you with a one-month temporary license to evaluate without any watermarks and restrictions, please apply for a temporary license from this link: https://www.e-iceblue.com/TemLicense.html. If there is any question, please feel free to write back.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1650
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS