You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I loaded a workbook from my local drive, delete a worksheet and save the workbook. When I tried to open the workbook by double-clicking the output file, Excel threw an error.
If I added a new worksheet, keeping the total number of worksheet same as the loaded workbook, no error was encountered.
The version of openxlsx2 is 1.0.
The version of R is 4.3.0.
Here is the reprex.
library(openxlsx2)
#> Warning: package 'openxlsx2' was built under R version 4.3.1# Excel prompts error when the file is being openedwb<- wb_load("test file.xlsx")
#> Error in wb_load("test file.xlsx"): File does not exist.wb$get_sheet_names()
#> Error in eval(expr, envir, enclos): object 'wb' not foundwb$remove_worksheet(1)
#> Error in eval(expr, envir, enclos): object 'wb' not foundwb$get_sheet_names()
#> Error in eval(expr, envir, enclos): object 'wb' not found
wb_save(wb, "test_out.xlsx")
#> Error in eval(expr, envir, enclos): object 'wb' not found# {no errorwb<- wb_load("test file.xlsx")
#> Error in wb_load("test file.xlsx"): File does not exist.wb$get_sheet_names()
#> Error in eval(expr, envir, enclos): object 'wb' not foundwb$remove_worksheet(1)
#> Error in eval(expr, envir, enclos): object 'wb' not foundwb$get_sheet_names()
#> Error in eval(expr, envir, enclos): object 'wb' not foundwb$add_worksheet("new1")
#> Error in eval(expr, envir, enclos): object 'wb' not foundwb$get_sheet_names()
#> Error in eval(expr, envir, enclos): object 'wb' not found
wb_save(wb, "test_out.xlsx")
#> Error in eval(expr, envir, enclos): object 'wb' not found# }
I loaded a workbook from my local drive, delete a worksheet and save the workbook. When I tried to open the workbook by double-clicking the output file, Excel threw an error.
If I added a new worksheet, keeping the total number of worksheet same as the loaded workbook, no error was encountered.
The version of openxlsx2 is 1.0.
The version of R is 4.3.0.
Here is the reprex.
Created on 2023-09-11 with reprex v2.0.2
test file.xlsx
The text was updated successfully, but these errors were encountered: