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 Feb 07, 2019 5:29 pm

Hello,

I use FreeSpire.xls V.8.3.0 installed via NuGet and Excel 365 / Windows 10 with Visual Studio 2017 / C#.

I try to open a xlsx file "Test.xlsx" and replace a text.
When I open the resulting "Replaced.xlsx" Excel shows me an error :
(The message is in german language.... I try to translate)

There was a problem with the content.
Should we repair ?

If I cklick yes I get a message
Excel file is damaged

What could be the problem ?


Code:

Code: Select all
using Spire.Xls;
using Spire.Pdf;
using Spire.Xls.Converter;

namespace Excel2PDF_Spire
{
    class Program
    {
        static void Main(string[] args)
        {
            start();
        }

        static void start()
        {

            //Create a new workbook
            Workbook workbook = new Workbook();
         
            //Load a file and imports its data
            workbook.LoadFromFile(@"c:\temp\Test.xlsx");
         
            //Initialize worksheet
            Worksheet sheet = workbook.Worksheets[0];

            //do something
            replaceText(sheet, "Test1", "neuer Text Test1");
           
            //save result
            workbook.SaveToFile(@"c:\temp\Replaced.xlsx");
         
        }
      
      static void replaceText(Worksheet sheet, string orginalText, string newText)
        {
            CellRange[] ranges = sheet.FindAllString(orginalText, false, false);

            foreach (CellRange range in ranges)
            {
                range.Text = newText;
               
            }

        }
      
}

Heinz4711
 
Posts: 20
Joined: Thu Feb 07, 2019 5:22 pm

Fri Feb 08, 2019 4:50 am

Hi,

Thank you for your inquiry.
Please share your sample Excel file to help us look into the case.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Fri Feb 08, 2019 3:17 pm

Jane.Bai wrote:Hi,

Thank you for your inquiry.
Please share your sample Excel file to help us look into the case.


Hello,

I attach the excel file that causes this error.
Attachments
Test.zip
(6.97 KiB) Downloaded 185 times

Heinz4711
 
Posts: 20
Joined: Thu Feb 07, 2019 5:22 pm

Mon Feb 11, 2019 3:30 am

Hello,

Sorry for the inconvenience caused by the free version. I have confirmed that your attached file worked well with the hotfix Spire.XLS Pack(Hotfix) Version:9.1.22. Please apply it and try again.
In addition, we can offer you a one-month free license to help remove the warning message. Please tell us if you need.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Sun Feb 17, 2019 5:40 pm

It has ape-red me the same problem, and my version of the program is the latest one, and im using win7 and the codeck pack from media player classic, that includes the latest codecks. How can i solve this problem?
[url=https://buyonlinemodafinil.com/]https://buyonlinemodafinil.com/[/url]
User avatar

MarvinHANNY
 
Posts: 2
Joined: Wed Feb 13, 2019 10:40 am
Location: Peru

Mon Feb 18, 2019 3:41 am

Dear MarvinHANNYSZ,

Thank you for contacting us.
Do you mean that you encounter the error that your generated .XLSX file prompts the information (There was a problem with the content) after using our Spire.XLS? If so, could you please provide your input Excel file (if any), generated Excel file as well as your testing code to help us have a better investigation on your issue? You could send them to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.XLS