There may be a misunderstanding of what colNames = TRUE does. Here are some examples. First I read in the entire sheet with colNames = FALSE. This shows what the data look like in Excel. I then read in the entire sheet but with colNames = TRUE. All of the row numbers shift by one because the first row is used as column names. I then read a subset of the sheet, D7:F10 both with and without using the first row as column headers.
library(openxlsx)
File <- "/home/fjcc/R/Play/Source.xlsx"
wb <- loadWorkbook(file = File)
#Read the whole sheet with the first row Not used as headers
DF1 <- read.xlsx(wb, sheet = 1, colNames = FALSE)
DF1
#> X1 X2 X3 X4 X5 X6
#> 1 First Second Third Fourth Fifth Sixth
#> 2 23 28.29 34.7967 1 3 11
#> 3 25 30.75 37.8225 2 4 22
#> 4 26 31.98 39.3354 3 5 33
#> 5 27 33.21 40.8483 4 6 44
#> 6 28 34.44 42.3612 5 7 55
#> 7 28 34.44 42.3612 A s d
#> 8 29 35.67 43.8741 1 4 7
#> 9 30 36.9 45.387 2 5 8
#> 10 <NA> <NA> <NA> 3 6 9
#Read the whole sheet with the first row used as headers
DF2 <- read.xlsx(wb, sheet = 1, colNames = TRUE)
DF2
#> First Second Third Fourth Fifth Sixth
#> 1 23 28.29 34.7967 1 3 11
#> 2 25 30.75 37.8225 2 4 22
#> 3 26 31.98 39.3354 3 5 33
#> 4 27 33.21 40.8483 4 6 44
#> 5 28 34.44 42.3612 5 7 55
#> 6 28 34.44 42.3612 A s d
#> 7 29 35.67 43.8741 1 4 7
#> 8 30 36.90 45.3870 2 5 8
#> 9 NA NA NA 3 6 9
#Read D7:F10 of the first sheet, use row 7 as headers.
DF3 <- read.xlsx(wb, sheet = 1, colNames = TRUE, rows = seq(7, 10), cols = seq(4,6))
DF3
#> A s d
#> 1 1 4 7
#> 2 2 5 8
#> 3 3 6 9
#Read D7:F10 of the first sheet, do not use row 7 as headers.
DF4 <- read.xlsx(wb, sheet = 1, colNames = FALSE, rows = seq(7, 10), cols = seq(4,6))
DF4
#> X1 X2 X3
#> 1 A s d
#> 2 1 4 7
#> 3 2 5 8
#> 4 3 6 9