J19
J19

Reputation: 717

Get the value of a cell referenced with full address

I have an Excel AddIn and I have a taskpane with a textbox. I would like to fill this textbox with a cell address, i.e. =Sheet1!A1 or =Sample!B4 ...., and get the value of this cell. I fill my textbox with a cell address and I want to solve this address with the value of the reference cell. I'm using javascript without jquery. How can I do this with from my addind?

Upvotes: 0

Views: 621

Answers (1)

Rick Kirkham
Rick Kirkham

Reputation: 9769

If I understand your scenario, I think you just need to read the address from the textbox. Parse it with JavaScript string split() method to separate the worksheet name from the grid address. Then pass the worksheet name to Workbook.worksheets.getItem() to get a reference to the worksheet. Then pass the grid address to the worksheet.getRange method. Then use Range.load to load the values property and then context.sync. This will bring the value of the range into your add-in.

Upvotes: 1

Related Questions