首页 > 解决方案 > Node js如何连接读取文件excel云(在线)?

问题描述

我有一个使用节点 js 的项目,我想从微软连接到一个 excel(云)在线文件。如何在线读取excel文件,监听文件更改事件。

请 !!!

我试过点分享!但不工作!`

var url = 'https://myproject.sharepoint.com/personal/name';  
var username = "username@microsoft.com.";  
var password = "*******";  


app.get('/',(req,res,next) => {
    console.log(req.connection.remoteAddress)
   spauth.getAuth(url, {          
    username:username,  
    password:password  
})  
.then(function(options){  
     // Access Token will be available on the options.headers variable
     var listTitler="OP Production Tracking Online Ver3.1";
       


     var headers = options.headers;  
     headers['Accept'] = 'application/json;odata=verbose';  
     // Pull the SharePoint list items  
     requestprom.get({  
     url: url+"/_api/web/lists/getbytitle('"+listTitler+"')",  
         headers: headers,  
         json: true  
     }).then(function(listresponse){  
         var items = listresponse.d.Title;  
         var responseJSON = [];  
         // process  
           
        
         console.log(JSON.stringify(listresponse))
       //  response.end( JSON.stringify ( listresponse ));  
           
    
 });   
});  
`

标签: node.jsexcel

解决方案


您可以使用Excel JavaScript API读取和跟踪文件中的任何更改。该文档为您提供了许多可用于使用 Excel 表格的方法。


推荐阅读