This is my 1st post here :)
I am writing a powershell code that triggers a macro in an Excel workbook.
The code works just fine, but I have an issue that the code openes the file as a Read Only. The problem does not occur, when I open the file manually.
When I tried to get isReadOnly value, Powershell advised me that the specific file does not have such a value. I tried also Trust Center and Antivirus solutions as per Microsoft website (https://learn.microsoft.com/en-us/sharepoint/troubleshoot/lists-and-libraries/files-open-as-read-only-and-cannot-check-in-or-out).
I tried also solution from here: How to get PowerShell to supress read-only mode, and allow editing when opening Excel workbook? , without any effect
$excel = New-Object -comobject Excel.Application
$FilePath = 'SharePoint/testTest.xlsm'
$workbook = $excel.Workbooks.Open($FilePath)
$excel.Visible = $true
$app = $excel.Application
$app.Run("Macro1")
$excel.Quit()
Can I somehow force opening it as editable?