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

cloneWorksheet returns an error #27

Closed
RMachineLearningLLC opened this issue Dec 8, 2019 · 2 comments
Closed

cloneWorksheet returns an error #27

RMachineLearningLLC opened this issue Dec 8, 2019 · 2 comments
Labels
fixed Fixed, issue will be closed within 7 days question Further information is requested waiting for answer If not answered, the issue will be closed in 7 days.

Comments

@RMachineLearningLLC
Copy link

Expected Behavior

Clone a sheet on a created workbook

Actual Behavior

library(openxlsx, lib.loc = "C:/Program Files/R/R-3.3.3/library")

wb <- createWorkbook("Fred")
addWorksheet(wb, "Sheet 1")
cloneWorksheet(wb, "Sheet 2", clonedSheet = "Sheet 1")
Error in wb$cloneWorksheet(sheetName = sheetName, clonedSheet = clonedSheet) :
could not find function "validateSheet"�

The function validateSheet() is called by:

wb$cloneWorksheet
Class method definition for method cloneWorksheet()
function (sheetName, clonedSheet)
{
clonedSheet = validateSheet(clonedSheet)
if (!missing(sheetName)) {
if (grepl(pattern = ":", x = sheetName))
stop("colon not allowed in sheet names in Excel")�
........
}

sessionInfo()

R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server x64 (build 14393)

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] openxlsx_4.1.4

loaded via a namespace (and not attached):
[1] tools_3.3.1 Rcpp_1.0.2 stringi_1.4.3 zip_2.0.4 �

  • Version of openxlsx: 4.1.4
  • Version of R: 3.3.3

Thanks for looking into it.

David

@ycphs
Copy link
Owner

ycphs commented Dec 9, 2019

Hi David,

I tried it to reproduce the error.

Please try to reinstall the package.

I tested the package on RHub with the new test for the cloneWorksheet function.
rhub Windows Server test

Instead of copying an empty worksheet I recommand to use addWorksheet.

@ycphs ycphs added the question Further information is requested label Dec 9, 2019
@ycphs ycphs added the waiting for answer If not answered, the issue will be closed in 7 days. label May 4, 2020
@ycphs
Copy link
Owner

ycphs commented May 19, 2020

The current development version doesn't have the issue.

Please check.

@ycphs ycphs added the fixed Fixed, issue will be closed within 7 days label May 19, 2020
@ycphs ycphs closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Fixed, issue will be closed within 7 days question Further information is requested waiting for answer If not answered, the issue will be closed in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants