1.引用(使用版本是17.7)
using Aspose.Cells;
2.使用方法
/// <summary>
/// 保存指定sheet中的文件
/// </summary>
/// <param name="sheet">指定sheet</param>
/// <param name="saveFolderPath">文件夹路径</param>
public void SaveOleFiles(Worksheet sheet, string saveFolderPath)
{
foreach (var oleObject in sheet.OleObjects)
{
//判断是否是文件
if (oleObject.FileFormatType != FileFormatType.Unknown)
{
var datas = oleObject.ObjectData;
File.WriteAllBytes(System.IO.Path.Combine(saveFolderPath,oleObject.ObjectSourceFullName), datas);
}
}
}