Skip to content

Improve efficiency in Office.js #347

@fzumstein

Description

@fzumstein

Across xlwings.js:

This loads the full worksheets collection (worksheets.load("items")) just to access a single sheet by index. If Office.js supports it in your target runtime, prefer context.workbook.worksheets.getItemAt(action.sheet_position) to avoid loading/syncing all worksheets and reduce overhead on large workbooks.

Loading values:

Optimize getBookData() Without Architecture Change
Idea: Keep loading all sheets but make it faster.

Optimizations:

Skip sheets with empty used range
Only load values (skip numberFormatCategories when not needed)
Batch context.sync() calls more efficiently
Use getUsedRangeOrNullObject to avoid loading huge empty areas
Parallelize sheet loading where possible (Office.js batching)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions