Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fillMergedCells fails in NamedRegions #318

Closed
Skepe opened this issue Jan 14, 2022 · 2 comments
Closed

fillMergedCells fails in NamedRegions #318

Skepe opened this issue Jan 14, 2022 · 2 comments
Labels

Comments

@Skepe
Copy link

Skepe commented Jan 14, 2022

Dear ycphs,

This is the requested issue transfer from awalker89/openxlsx#530. As described there as well it might be related to another open issue openxlsx/issues/499.
Thank you for maintaining this package! Sorry for the delay... :-)

Expected Behavior

I created a named region "NameReg" -> A1:D3 with some merged cells inside in an excel file
NamedMergedCell_Example.xlsx.

If I access this region without the name option it workes nicely, all merged cells are recognized and each cell is filled with the value of the merged cell:
dput(openxlsx::read.xlsx("NamedMergedCell_Example.xlsx", fillMergedCells = TRUE))
structure(list(Hello = c("A", "B"), World = c(1, 4), World = c(2,
4), World = c(3, 4)), row.names = 1:2, class = "data.frame")

This should also work if I use the named Region

dput(openxlsx::read.xlsx("NamedMergedCell_Example.xlsx", namedRegion = "NameReg",fillMergedCells = TRUE))

but it does not.

Actual Behavior

dput(openxlsx::read.xlsx("NamedMergedCell_Example.xlsx", namedRegion = "NameReg",fillMergedCells = TRUE))

leads to
structure(list(Hello = c("A", "B"), World = c(1, 4), X3 = c(2,
NA), X4 = c(3, NA)), row.names = 1:2, class = "data.frame")

The merged cell is not resolved. Only the first cell gets its value all others are NA.

Steps to Reproduce the Problem

NamedMergedCell_Example.xlsx

1. Put NamedMergedCell_Example.xlsx in your working directory.

2. Execute dput(openxlsx::read.xlsx("MergedCell_Example.xlsx", namedRegion = "NameReg", fillMergedCells = TRUE))

sessionInfo()

  • Version of openxlsx: 4.2.3
  • Version of R: 4.0.5
@github-actions
Copy link

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jan 21, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant