Pending Review
Last Updated: 11 Jun 2025 07:28 by Anchal

Summary 

After editing an Excel `.xlsx` file using Telerik RadSpreadsheet and saving it via the default Save option, the saved file becomes corrupted. It no longer opens in RadSpreadsheet (throws an error) and shows a repair warning in Microsoft Excel. 

Reproduction Steps 

1. Upload an Excel `.xlsx` file to the `ABC` folder on the server. 

2. Load the file in RadSpreadsheet via a basic viewer page. 

3. Make any small edit (e.g., change a cell’s value). 

4. Click the built-in Save option in the RadSpreadsheet toolbar. 

5. Attempt to: 

   - Reopen the saved file in RadSpreadsheet → Error: Object reference not set to an instance of an object. 

   - Open in Excel → Warning: “We found a problem with some content in ‘filename’. Do you want us to try to recover as much as we can?” 

Files Attached 

- `Original.xlsx` — Before editing, opens fine in both RadSpreadsheet and Excel. 

- `Modified.xlsx` — After saving via RadSpreadsheet, causes errors. 

- Screenshot of: 

   - RadSpreadsheet error : 

Picture 

   - Excel repair prompt 

Picture 

Code Snippet : 

<telerik:RadSpreadsheet ID="sample" runat="server" Visible="false" style="font-size: 10px;" /> 

protected void Page_Load(object sender, EventArgs e) 

{ 

    string fileName = (string)Session["SelectedFileName"]; 

    SheetLoad(fileName); 

} 

  

private void SheetLoad(string fileName) 

{ 

    try 

    { 

        string filePath = Server.MapPath("~/ABC/" + fileName); 

        if (!File.Exists(filePath)) 

        { 

            string errorMsg = "File not found: " + filePath; 

            ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('File not found!');", true); 

            return; 

        } 

  

        // Load spreadsheet using Telerik document provider 

        sample.Provider = new SpreadsheetDocumentProvider(filePath); 

        sample.Visible = true; 

    } 

    catch (Exception ex) 

    { 

        string errorMsg = "Error opening file: " + ex.Message + " | File: " + fileName; 

        ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Error loading file!');", true); 

    } 

} 

  

**Observation:** 

  

* This only happens for **some files**, especially ones that likely contain advanced Excel features. 

* Other simpler files save and reload without any issue. 

  

**Assumption:** 

It seems the default save behavior of RadSpreadsheet is **not preserving some Excel structures**, leading to file corruption on save. 

  

 


Pending Review
Last Updated: 24 May 2025 15:25 by Ralph

Dear Telerik Support.  I found another bug related to this one below.

https://feedback.telerik.com/aspnet-ajax/1688270-uncaught-typeerror-cannot-read-properties-of-null-reading-classname?_gl=1*iuxa0l*_gcl_au*NjcwNTkzNi4xNzQ3Njc4MzQz*_ga*OTAxNzk1OTc4LjE3Mzk4MjI5NzY.*_ga_9JSNBCSF54*czE3NDgwOTkxODEkbzIxJGcxJHQxNzQ4MDk5NTIzJGo1NCRsMCRoMCRkRlJROUp0Q0RDUUZTUlZUeFlLLU9ja3RBc2UwczF3ZU55Zw..

This line of code also causes the same issue.

$find("txtYear").clear();

See attached Console debug output.

It is my opinion that a hot fix needs to be done asap!  The work around that Derek posted on May 23rd falls short of the bigger issue.  This is a serious matter and needs to be addressed immediately.