awalker89 / openxlsx

R package for .xlsx file reading and writing.
Other
364 stars 79 forks source link

write.xlsx with firstActiveRow = TRUE breaks vertical scroll #405

Open sritchie73 opened 6 years ago

sritchie73 commented 6 years ago

Expected Behavior

For spreadsheets with more rows than can fit on the screen, scroll with the trackpad / mouse should scroll vertically through rows - this is what happens in spreadsheets that are not created by openxlsx.

Actual Behavior

Attempting to scroll will either do nothing, or if there are a sufficient number of columns will scroll the spreadsheet horizontally instead of vertically. Attempting to manually move through the file with arrow keys or by dragging the scroll bar on the right also does not scroll through rows.

Steps to Reproduce the Problem

library(openxlsx)
library(datasets)
write.xlsx(datasets::quakes, firstActiveRow = TRUE, file = "test.xlsx")

# Note the following creates a spreadsheet where vertical scroll works correctly:
# write.xlsx(datasets::quakes, file = "test.xlsx")

Output spreadsheet attached: test.xlsx

I've reproduced this problem using the above code in R 3.5.0 with openxlsx 4.1.0 on OSX Sierra 10.12.6 with Microsoft Excel for Mac Version 15.23, but first observed the problem in Excel on OSX Sierra using spreadsheets generated in R/3.4.1 with openxlsx 4.1.0 on Scientific Linux release 6.8