I am using EPPlus to read data from .XLSX file.
issue is it is not able to read locked cells. So I have to open excel, Unlock cells, and then upload. Is there way to read lock cells. I tried as below:
For row As Integer = workSheet.Dimension.Start.Row + 1 To workSheet.Dimension.[End].Row
workSheet.Cells(row, vLocation).Style.Locked = False
Dim strLocation = Convert.ToString(workSheet.Cells(row, vLocation).Value)
Next
Even i tried following code to unlock the worksheet with EPPlus
Try
workSheet.Protection.IsProtected = False
workSheet.Cells("A1:Z200").Style.Locked = False
Catch ex As Exception
End Try
But it does not work. If I unlock cells manually and upload file then it works.
otherwise following line returns nothing
Dim strLocation = Convert.ToString(workSheet.Cells(row, vLocation).Value)