Hi all,
I'm working on a PowerShell script to read content in excel file hosted in SharePoint online in office 365.
My goal is retrieve content for cell B2 from the file.
My code so far,
$Excel = New-Object -ComObject Excel.Application
$Workbook = $Excel.Workbooks.Open("\\bernardcomms.sharepoint.com\sites\Test_Site\Documents\test_with_macro.xlsm")
$Excel.Workbooks.CheckOut("\\bernardcomms.sharepoint.com\sites\Test_Site\Documents\test_with_macro.xlsm")
# Get the first sheet in excel file
$workSheet = $Workbook.Sheets.Item(1)
$WorkSheet.Name
# Get value for cell B2
$mailto = $workSheet.cells.Item(2, 2).Text
$mailto.Text
On executing the script above, it just hangs. What am i doin wrong.