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

Cloned worksheet with note throws error on wb_save #658

Closed
DavZim opened this issue Jun 22, 2023 · 2 comments
Closed

Cloned worksheet with note throws error on wb_save #658

DavZim opened this issue Jun 22, 2023 · 2 comments

Comments

@DavZim
Copy link

DavZim commented Jun 22, 2023

I have a worksheet with a note (not comment).
When I clone the worksheet, the wb_save() command throws an error.

image

I use this test-file test.xlsx.

library(openxlsx2)
wb <- wb_load("https://github.com/JanMarvin/openxlsx2/files/11833189/test.xlsx")
wb$clone_worksheet(1, "ASD")
wb$save("test2.xlsx")
#> Error in FUN(X[[i]], ...) : subscript out of bounds
traceback()
#> 5: lapply(X = X, FUN = FUN, ...)
#> 4: sapply(comment_list, "[[", "author")
#> 3: unique(sapply(comment_list, "[[", "author"))
#> 2: write_comment_xml(comment_list = self$comments[[i]], file_name = file.path(tmpDir, 
#>        "xl", fn))
#> 1: wb$save("test2.xlsx")
@JanMarvin
Copy link
Owner

Thanks (once again) for reporting! A fix is in main.

@DavZim
Copy link
Author

DavZim commented Jun 22, 2023

Thank you for the quick fixes! <3

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

No branches or pull requests

2 participants