How to get PowerShell to supress read-only mode, and allow editing when opening Excel workbook?
For Workbooks.Open
:
- The 3rd parameter is ReadOnly and should be
$false
. - The 7th parameter is IgnoreReadOnlyRecommended and should be
$true
. - Use
[Type]::Missing
for the 4th-6th parameters.
$workbook = $excel.Workbooks.Open($FilePath, $null, $false, [Type]::Missing, [Type]::Missing, [Type]::Missing, $true)