sharepoint - 从存储在文档库中的 Excel 中获取数据并使用 powershell 将其显示在列表中

标签 sharepoint powershell

我必须从存储在我的文档库中的 Excel 文档中获取数据,并将数据显示在列表中。我的脚本运行良好,但在 $workbook 处提示我传递凭据。

这个问题能解决吗?

$web = Get-SPWeb -Identity 'http://.....'
$list = $web.Lists['XL List']
$XLSDoc ='http://...'
$SheetName = 'Overall Project Health'
$Excel = New-Object -ComObject 'Excel.Application'
$Workbook = $Excel.workbooks.open($XLSDoc)....
$Sheet = $Workbook.Worksheets.Item($SheetName)

最佳答案

试试这个:

$Workbook = $Excel.workbooks.open($XLSDoc, $false, $true)

引用:

http://msdn.microsoft.com/en-us/library/aa195811(office.11).aspx

关于sharepoint - 从存储在文档库中的 Excel 中获取数据并使用 powershell 将其显示在列表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15383379/

相关文章:

sharepoint - 单个 MOSS 站点上的多个主机名

sharepoint - 使用 Sharepoint 作为 QnA Maker 的源

powershell - 如何使用 PowerShell 设置新 SharePoint 字段的内部名称?

powershell - 没有标题的Powershell export-csv?

powershell - 如何在Powershell数组中写入托管元素的单个属性?

powershell - 我怎样才能一劳永逸地摆脱这个循环呢?

powershell - 在 SharePoint 中获取 "Shared with Everyone"文件夹信息

sql - 从 SQL 返回 200mb blob 需要多长时间