Open/Edit docs stored on Microsoft Teams
I am trying to use matlab (2024a) to open (and eventually edit) an excel doc that is stored in Microsoft teams. I am getting a 403 Forbidden response. Our IT department is stumped, as I am entering the correct credentials when prompted. Anyone been able to get around this?
Here is my code:
% Prompt for username and password
prompt = {‘Enter your username:’, ‘Enter your password:’};
dlgtitle = ‘SharePoint Login’;
dims = [1 35];
definput = {”, ”};
answer = inputdlg(prompt, dlgtitle, dims, definput);
% Extract username and password
username = answer{1};
password = answer{2};
% URL for the SharePoint file
url = ‘https://indiana.sharepoint.com/sites/msteams_c777c3-DistVRT/_api/web/GetFileByServerRelativeUrl(”/sites/msteams_c777c3-DistVRT/Shared%20Documents/DistVRT/DistVRT_v4_SF_DataScoringLog.xlsx”)/$value’;
% Web options with the provided credentials
options = weboptions(‘Username’, username, ‘Password’, password, ‘Timeout’, 60);
% Read the file from SharePoint
data = webread(url, options);
data = readtable(‘https://indiana.sharepoint.com/sites/msteams_c777c3-DistVRT/Shared%20Documents/DistVRT/DistVRT_v4_SF_DataScoringLog.xlsx’,’ReadVariableNames’,1); %calls in text file of data for this subjectI am trying to use matlab (2024a) to open (and eventually edit) an excel doc that is stored in Microsoft teams. I am getting a 403 Forbidden response. Our IT department is stumped, as I am entering the correct credentials when prompted. Anyone been able to get around this?
Here is my code:
% Prompt for username and password
prompt = {‘Enter your username:’, ‘Enter your password:’};
dlgtitle = ‘SharePoint Login’;
dims = [1 35];
definput = {”, ”};
answer = inputdlg(prompt, dlgtitle, dims, definput);
% Extract username and password
username = answer{1};
password = answer{2};
% URL for the SharePoint file
url = ‘https://indiana.sharepoint.com/sites/msteams_c777c3-DistVRT/_api/web/GetFileByServerRelativeUrl(”/sites/msteams_c777c3-DistVRT/Shared%20Documents/DistVRT/DistVRT_v4_SF_DataScoringLog.xlsx”)/$value’;
% Web options with the provided credentials
options = weboptions(‘Username’, username, ‘Password’, password, ‘Timeout’, 60);
% Read the file from SharePoint
data = webread(url, options);
data = readtable(‘https://indiana.sharepoint.com/sites/msteams_c777c3-DistVRT/Shared%20Documents/DistVRT/DistVRT_v4_SF_DataScoringLog.xlsx’,’ReadVariableNames’,1); %calls in text file of data for this subject I am trying to use matlab (2024a) to open (and eventually edit) an excel doc that is stored in Microsoft teams. I am getting a 403 Forbidden response. Our IT department is stumped, as I am entering the correct credentials when prompted. Anyone been able to get around this?
Here is my code:
% Prompt for username and password
prompt = {‘Enter your username:’, ‘Enter your password:’};
dlgtitle = ‘SharePoint Login’;
dims = [1 35];
definput = {”, ”};
answer = inputdlg(prompt, dlgtitle, dims, definput);
% Extract username and password
username = answer{1};
password = answer{2};
% URL for the SharePoint file
url = ‘https://indiana.sharepoint.com/sites/msteams_c777c3-DistVRT/_api/web/GetFileByServerRelativeUrl(”/sites/msteams_c777c3-DistVRT/Shared%20Documents/DistVRT/DistVRT_v4_SF_DataScoringLog.xlsx”)/$value’;
% Web options with the provided credentials
options = weboptions(‘Username’, username, ‘Password’, password, ‘Timeout’, 60);
% Read the file from SharePoint
data = webread(url, options);
data = readtable(‘https://indiana.sharepoint.com/sites/msteams_c777c3-DistVRT/Shared%20Documents/DistVRT/DistVRT_v4_SF_DataScoringLog.xlsx’,’ReadVariableNames’,1); %calls in text file of data for this subject importing excel data, microsoft teams, permissions MATLAB Answers — New Questions