Task Pane App Excel - The supplied data object type is not supported error recieved


i believe passing in array of arrays in following code. data object type not supported.

function bindingforallcsv(csvdict) {      var end = 0;      var res = csvdict[3].value.split("\r\n");      var type = "16";      var rowct = res.length;      var namedrange = "a" + (end + 1) + ":k" + (end + rowct + 1);      var id = "rec" + type;      var bnding = "bindings#" + id;      office.context.document.bindings.addfromnameditemasync(namedrange, "matrix", { id: id },          function(asyncresult) {              if (asyncresult.status == "failed") {                  write('error: ' + asyncresult.error.message);              }          });              //calculate field arrays , put in row arrays      var row = [];      var fields = [];      (var j = 0; j < res.length; j++) {          fields = res[j].split(",");          row.push(fields);      }      office.select(bnding).setdataasync(row, { coerciontype: "matrix" },          function(asyncresult) {              if (asyncresult.status == "failed") {                  write('error: ' + asyncresult.error.message);              }          });      }
i'm not real adept @ javascript not sure have array of arrays.

john donnelly

hi john,

to write data table range in the worksheet, need define parameter this:

function bindingforallcsv(csvdict) {         var end = 0;         var mytable = new office.tabledata();         mytable.header = ['recordcode', 'typecode', 'codedesc', 'summcode', 'summcodedesc', 'sign', 'amount', 'fundstype', 'bankrefnum', 'custrefnum', 'desctext'];         mytable.rows = [['recordcode', 'typecode', 'codedesc', 'summcode', 'summcodedesc', 'sign', 'amount', 'fundstype', 'bankrefnum', 'custrefnum', 'desctext'],['16', '169', '1', '2', '3', '4', '5', '6', '7', '8', '9'], ['16', '169', '1', '2', '3', '4', '5', '6', '7', '8', '9']];         var type = "3";         var rowct = mytable.length;         var namedrange = "a" + (end + 1) + ":k" + (type);         var id = "rec" + type;         var bnding = "bindings#" + id;         office.context.document.bindings.addfromnameditemasync(namedrange, "table", { id: id },             function (asyncresult) {                 if (asyncresult.status == "failed") {                     write('error: ' + asyncresult.error.message);                 }             });         office.select(bnding).setdataasync(mytable, { coerciontype: "table" },             function (asyncresult) {                 if (asyncresult.status == office.asyncresultstatus.failed) {                     write('error: ' + asyncresult.error.message);                 } else {                     write('bound data: ' + asyncresult.value);                 }             });     }

the result:

for more information, please refer binding.setdataasync method (javascript api office v1.1).


we trying better understand customer views on social support experience, participation in interview project appreciated if have time. helping make community forums great place.
click here participate survey.



Microsoft Office for Developers  ,  Apps for Office and SharePoint  >  Developing Apps for Office 2013



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'