tec-goblin
tec-goblin

Reputation: 316

Cannot access worksheets of created workbook

It's a follow up to Can I create a workbook with Excel javascript add in? Once a workbook is created by the Excel Add-In with the upcoming 1.8 version of the API, the worksheets are undefined or null

const wb = context.application.createWorkbook(); 
wb.open();
await context.sync();
wb.worksheets.getFirst(false).getRange("A1").values = (my values);

I get a message "cannot find property getFirst of undefined or null". Am I doing something wrong? Please mind that I enrolled to Office insider (Insider) but it doesn't seem to offer an update (I'm at version 1804).

Upvotes: 2

Views: 124

Answers (1)

Juan Balmori
Juan Balmori

Reputation: 5036

Great question. That functionality is something we are planning to support in the long term. For now the returned workbook cannot be accessed though the API, the only method you can use is the Open() method. The goal of this API in its current shape is to be able to open either a blank workbook or an existing one (if you pass a base64 encoded xlsx)

Upvotes: 2

Related Questions