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

Replace existing worksheet #490

Open
cmwakibia opened this issue Aug 14, 2024 · 0 comments
Open

Replace existing worksheet #490

cmwakibia opened this issue Aug 14, 2024 · 0 comments

Comments

@cmwakibia
Copy link

Is your feature request related to a problem? Please describe.
When you have multiple tables you would want to export using openxlsx, with the styling being the same across all worksheets but the data, sheet number (or name) and sheet titles differing, writing a function helps with this. However, the function will raise an error if you try to call the same function more than once without creating the workbooks a fresh.

Describe the solution you'd like
I would like a feature - an argument when using openxlsx::writeData or openxlsx::writeDataTable. This would be similar to overwrite argument in openxlsx::saveWorkbook function

Describe alternatives you've considered

  • I have considered openxlsx::removeTable(), and openxlsx::removeWorksheet() which have not been efficient in solving my problem.
  • I have also tried custom checking if the table already exists in the workbook, if it does remove it and then add it

Therefore I believe the feature would have a more standard and efficient approach of overwriting existing worksheets

Additional context

P.S. openxlsx is one of my favorite R packages! Kudos and thanks so much to the development/maintenance team!

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

1 participant