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

selectRangeValues is not selecting a range of cells #381

Open
DktPhl2019 opened this issue Oct 16, 2024 · 1 comment
Open

selectRangeValues is not selecting a range of cells #381

DktPhl2019 opened this issue Oct 16, 2024 · 1 comment

Comments

@DktPhl2019
Copy link

Hello

I need to select a range of cells, but the code is not selecting any range.

After running the code, the cell A1 is selected, but the entire range of cells is not selected.

Could you please take a look.

Thank You

Here is the full code:

String myfile = 'C:/test/myfile.xlsx';
var bytes = File(myfile).readAsBytesSync();
      var excel = Excel.decodeBytes(bytes);
      Sheet sheetObj = excel['Sheet1'];
      var rowsMax = sheetObj.maxRows;
      var columnsMax = sheetObj.maxColumns;
      sheetObj.selectRangeValues(CellIndex.indexByColumnRow(columnIndex: 0,rowIndex: 0), end: CellIndex.indexByColumnRow(columnIndex: columnsMax, rowIndex: rowsMax));
      List<int>? fileBytes = excel.save();
      if (fileBytes != null) {
        File(join(myfile))
          ..createSync(recursive: true)
          ..writeAsBytesSync(fileBytes);
      }
@DktPhl2019
Copy link
Author

Hello! Could you please reply. There is no response for one month. Thank You

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