I thought about disposing it before saving it but then I'd probably get an exception informing me that the workbook is null. i tried a different directory just to be sure and the same thing happened. saving = exception while saving as a diff name = pass
- Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
Workbook wb = new Workbook();
wb.LoadFromFile(@"C:\Users\abc\x\Appendix\JOR 2023.xlsx");
//doesn't work. access denied
wb.Save();
//works because i renamed the file
wb.SaveToFile(@"C:\Users\abc\x\Appendix\NEW JOR 2023.xlsx");
Application.Exit();
}