-
Notifications
You must be signed in to change notification settings - Fork 1k
Make clipboard selection dimension properties available #720
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
base: develop
Are you sure you want to change the base?
Conversation
|
What does this have to do with clipboard? Dimensions is about where there is content in the sheet, and it contains in many documents incorrect information which is why ExcelDataReader does not use it. What is the intended use case for this? |
|
When copying a range of data of an worksheet from Excel to the clipboard (e. g. with Ctrl+C), Excel saves an document to the clipboard containing only the data at the location of the selected data. For example, if you select the range D3:E4 and then press Ctrl+C, the clipboard will contain amongst others an Excel document in Biff12 format, where only the range D3:E4 is filled with values. To be able to find the copied data range, the mentioned properties are filled accordingly by Excel. In this example, FirstRow will be 3, LastRow will be 4, FirstColumn will be 4 and LastColumn will be 5. Therefore when loading this Excel document from the clipboard using ExcelDataReader, these properties contain the necessary information to determine the location of the copied data range. |
|
I think this should be exposed as a Dimension property with a comment stating that it is unreliable. To make it clearer what it is. And test cases. |
|
I refactored the code to expose the clipboard-selection as property Dimension and added two tests (for Biff8 and Biff12). |
For using ExcelDataReader to parse clipboard content, one missing information is the dimension of the selected data range.
This pull requests adds four properties to IExcelDataReader, which contain that dimension:
These properties are filled for binary xls/xlsb format and xlsx format.