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

Files are Read Only after using EPPlus

Mar 2, 2016 at 9:20 PM
This is most likely a rookie question, but I've looked everywhere and I can't find the answer. I'm just starting to experiment with EPPlus, and it seems that no matter what I do, the file that gets created opens as Read-Only in Excel. Just to keep it simple, I stripped everything else out of my code and it still does it. Here is what I've got so far.
        Dim FilePath As New System.IO.FileInfo("C:\test.xlsx")
        Dim EPPlusPackage As New OfficeOpenXml.ExcelPackage()

        EPPlusPackage.Workbook.Worksheets.Add("Sheet1")

        EPPlusPackage.SaveAs(FilePath)

        End
Thanks for any help.
Mar 8, 2016 at 12:05 AM
well this was definitely a stupid mistake on my part. For any developers out there, don't save to a protected directory like "c:\". As soon as I redefined the save location to some other directory everything worked fine.