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

feature request / SaveTablesToWorkBook #50

Open
lscheffler opened this issue May 15, 2021 · 2 comments
Open

feature request / SaveTablesToWorkBook #50

lscheffler opened this issue May 15, 2021 · 2 comments

Comments

@lscheffler
Copy link

SaveTablesToWorkBook and SaveTablesToWorkBookEx do a great job.
Except I can not adress the location.
It will create a new sheet and start on A1. What I like would the possibility to (optionally) address:

  • an existing sheet
  • a starting cell for header
  • a starting cell for data
    The calling code must be responsible to place the stuff on something meaningful, so data should not write over header line.

Parameters like:

LPARAMETERS tcAlias, tnWB, tlFreeze, tlSaveWB,;
tvSheet, toHeaderLoc, toDataLoc

where

tvSheet

Type Char

as existing tcSheetName

Type Num

number (Id) of existing sheet to write to

Locs

toHeaderLoc and toDataLoc could be an empty object like

  • toHeaderLoc.BegCol
  • toHeaderLoc.BegRow

toHeaderLoc and toDataLoc are used for tvSheet as number only, only for existing tnWB too.


In this way I could fill data into an existing workbook / template and should be able to keep existing formats etc. As far as I see the write would work with existing sheets/cells.

@ggreen86
Copy link
Owner

Will look into adding this feature request. The SaveTablesToWorkBookEx() method is designed to write directly to a new spreadsheet file; so there is not an existing sheet to write to. Method SaveTablesToWorkBook() could be enhanced to selectively create a new sheet or write to an existing sheet. Both methods could have optional parameters for the starting column and row. However, the checking of existing data in the cells would add considerable overhead and then what to do if found? So I don't think this would be feasible.

@lscheffler
Copy link
Author

Sorry for the delay. First full of work, then vacation. :D
What I like to have for SaveTablesToWorkBook:

  • a way to address a sheet different then sheet number 1 - this is tvSheet Running number or sheet name. The calling code is responsible to create / name sheets if needed.
  • only write the data to the cells, this is
    • create cells if not existing
    • fill existing cells with data, but do not touch existing formats

I understand this is slower then just putting the data into an empty sheet. But it's still faster the using EXCEL automation for it. If EXCEL is available at all, what is a problem with the cloud based stuff. So for the speed it is a minor issue.

Sure, it could be an additional method, what keeps SaveTablesToWorkBook as simple and fast.

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