Excel file corrupted after load/save
New DiscussionHi,
In my application, I have to load and save many times excel files.
Some of them become corrupted after multiple saves.
I tried with a sample project to load and save multiple times and for an excel document, it become corrupted after 4 load/save.
Here is my sample code :
using System;
using Infragistics.Documents.Excel;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
const string filePath = "D:\\Template - ErrorAfter4Saves.xlsx";
for (var i = 0; i < 4; i++)
{
var workbook = Workbook.Load(filePath);
workbook.Save(filePath);
}
Console.WriteLine("File Corrupted !");
Console.ReadLine();
}
}
}
If i try to open it after running my sample code, it will be corrupted.
I don’t know why after 4 times.
Thank You for your answers.
Sign In
to post a reply
Replies
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Favorites
0 Replies
2 Created On
Jun 04, 2021 Last Post
7 years, 11 months ago