Skip to content

Commit

Permalink
Merge pull request #931 from Kotlin/read-only-excel
Browse files Browse the repository at this point in the history
Open File in readExcel in read-only mode
  • Loading branch information
Jolanrensen authored Oct 29, 2024
2 parents 4fc5f34 + 4ffb019 commit b76c5a2
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ public fun DataFrame.Companion.readExcel(
nameRepairStrategy: NameRepairStrategy = NameRepairStrategy.CHECK_UNIQUE,
): AnyFrame {
setWorkbookTempDirectory()
val wb = WorkbookFactory.create(file)
@Suppress("ktlint:standard:comment-wrapping")
val wb = WorkbookFactory.create(file, /* password = */ null, /* readOnly = */ true)
return wb.use {
readExcel(it, sheetName, skipRows, columns, stringColumns?.toFormattingOptions(), rowsCount, nameRepairStrategy)
}
Expand Down

0 comments on commit b76c5a2

Please sign in to comment.