Skip to content

Commit b76c5a2

Browse files
authored
Merge pull request #931 from Kotlin/read-only-excel
Open File in readExcel in read-only mode
2 parents 4fc5f34 + 4ffb019 commit b76c5a2

File tree

1 file changed

+2
-1
lines changed
  • dataframe-excel/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io

1 file changed

+2
-1
lines changed

dataframe-excel/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/xlsx.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ public fun DataFrame.Companion.readExcel(
131131
nameRepairStrategy: NameRepairStrategy = NameRepairStrategy.CHECK_UNIQUE,
132132
): AnyFrame {
133133
setWorkbookTempDirectory()
134-
val wb = WorkbookFactory.create(file)
134+
@Suppress("ktlint:standard:comment-wrapping")
135+
val wb = WorkbookFactory.create(file, /* password = */ null, /* readOnly = */ true)
135136
return wb.use {
136137
readExcel(it, sheetName, skipRows, columns, stringColumns?.toFormattingOptions(), rowsCount, nameRepairStrategy)
137138
}

0 commit comments

Comments
 (0)