This project has moved and is read-only. For the latest updates, please go here.

Error saving file using Epplus

Feb 11, 2011 at 4:21 PM

Hi Everyone,

I have a web application running on windows 7 64 bit on iis 7, When i create an excel package an try to save it with excelpackage.save method it throws the above exception with the path name specified. The folder in the path has full permissions for Network Service, IUSR, IIS_IUSR.Following is my code. I think it is a permissions issue.

strFileName = "c:\" & strFileName
Dim medFile As New FileInfo(strFileName)
If medFile.Exists Then
   medFile.Delete()
   medFile = New FileInfo(strFileName)
End If
Dim medPackage As New ExcelPackage(medFile)
Dim medWorkSheet As ExcelWorksheet = .Workbook.Worksheets.Add("Medicion" & ViewState("MEDICIONID"))
medWorkSheet.Cells(crtRow, crtCol).Value = "Medicion ID" 'Heading of the excel file
medPackage.save()

Thanks and Regards

Heti

strFileName = "c:\" & strFileName
Dim medFile As New FileInfo(strFileName)
If medFile.Exists Then
medFile.Delete()
medFile = New FileInfo(strFileName)
End If
Dim medPackage As New ExcelPackage(medFile)
Dim medWorkSheet As ExcelWorksheet = .Workbook.Worksheets.Add("Medicion" & ViewState("MEDICIONID"))
medWorkSheet.Cells(crtRow, crtCol).Value = "Medicion ID" 'Heading of the excel file
strFileName = "c:\" & strFileName
Dim medFile As New FileInfo(strFileName)
If medFile.Exists Then
   medFile.Delete()
   medFile = New FileInfo(strFileName)
End If
Dim medPackage As New ExcelPackage(medFile)
Dim medWorkSheet As ExcelWorksheet = .Workbook.Worksheets.Add("Medicion" & ViewState("MEDICIONID"))
medWorkSheet.Cells(crtRow, crtCol).Value = "Medicion ID" 'Heading of the excel file
medPackage.save()

medPackage.save()
Feb 11, 2011 at 4:40 PM

I forgot to give modify permissions. Got it working now