Accessing excel from file from sharepoint does not work

20 ビュー (過去 30 日間)
Lionel Pöffel
Lionel Pöffel 2020 年 8 月 12 日
コメント済み: Lionel Pöffel 2024 年 2 月 9 日
Hello,
the following code tries to open an excel file from some sharepoint location and to store it to disk. The result is a totally corrupted file that doesn't contain any data:
Excel=actxserver('Excel.Application');
EWorkBooks=Excel.Workbooks;
EFile=EWorkBooks.Open(<Sharepoint link to Excel file>);
EFile.SaveAs(<local disk location>);
EFile.Close;
Excel.Quit;
Opening the Excel file by hand on the sharepoint shows a file that is totally fine and not corrupted.
This code, however tries to open a word file from the exact same sharepoint location and to store it to disk. It works perfectly fine:
Word=actxserver("Word.Application");
Wordfile=Word.Documents.Open(<Sharepoint link to Word file>);
Wordfile.SaveAs2(<local disk location>);
Wordfile.Close;
Word.Quit;
delete(Word);
What am I doing wrong with the excel file?
  4 件のコメント
Sebastian Stumpf
Sebastian Stumpf 2024 年 2 月 9 日
Hi,
did you fix the problem? I also would like to access an Excel-File which is stored in Microsoft OneDrive, but not locally. I have the link of the Excel-File. I just want to read the data from it.
Thanks
Best regards,
Sebastian
Lionel Pöffel
Lionel Pöffel 2024 年 2 月 9 日
Yes. It turned out that documents created out of an associated TEAMs channel obtained unresolvable script-like links. Documents need to be explicitly uploaded onto the sharepoint out of the sharepoint GUI. Then they seem to obtain resolvable links.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMeasurements and Spatial Audio についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by