I used the following code to test the template workbook on ASP.net. It didn’t have problem on local host.
When I pushed all the files to production server, all the other users got access denied when starting open the template workbook. Please advise.
Thanks
Charlie
//Creating a Workbook object
Workbook templateWorkbook = new Workbook();
Workbook workbook = new Workbook();
string path = MapPath(".");
string tempFile = path + @"\FoodCount.xls";
templateWorkbook.Open(tempFile);
// copy it first
workbook.Copy(templateWorkbook);
// close the template
templateWorkbook.Save(tempFile, FileFormatType.Default);
Worksheet rawSheet = workbook.Worksheets[1]; // Data
Cells cells = rawSheet.Cells;
workbook.Save("New.xls", FileFormatType.Default, SaveType.OpenInBrowser, this.Response);