2

I am using Winnovative to write data to an excel sheet from my C# code. Writing data from a data table works fine without any issues. I intend to have a pie chart from the data I have written. So I have a template of the excel sheet where I have predrawn a pie chart for 3 columns and am trying to insert values there using my code instead of drawing the pie chart in code which is possible.

However when I try to open the excel file I get an error "Another process is using the excel file". So is the pie chart creation considered as a process running? Is there a way where I can define cells for the chart and define values to it from my code uysing Winnovative? Is there a way I can hold off the processing of the chart until the values from the code are passed?

This is my code where I am getting the exception.

string dataFilePath = System.IO.Path.Combine(Server.MapPath("~"), @"Data\awemployees.xls");
System.IO.FileStream sourceXlsDataStream = new System.IO.FileStream(dataFilePath, System.IO.FileMode.Open);

ExcelWorkbook tempWorkbook = new ExcelWorkbook(sourceXlsDataStream);//Error
TheFallenOne
  • 1,598
  • 2
  • 23
  • 57

0 Answers0