I have trouble saving WB that is opened as a read-only (from SharePoint server). Tried to add ReadOnly:=False
to line that opens up the workbook, but vba still stopps and points to line wb_gr.Save
.
Is there a way to get around this?
My code is located in a "master-dash" (same folder), that updates itself first, then opens next Dash, updates, saves and closes. And so on...
When opening "master-dash", I click and remove all warnings = it updates and saves ok.
Sub UpdateDash()
Dim fPath As String
Dim wb_gr As Workbook
fPath = ThisWorkbook.Path
If Right(fPath, 1) = "\" Then
fPath = Left(fPath, Len(fPath) - 1)
End If
Set wb_gr = Workbooks.Open(ThisWorkbook.Path & "\dashboard.xlsm", ReadOnly:=False, Notify:=False)
'(lot of updating going on - works just fine)
wb_gr.Save '(Run-time error 1004. No access to file C:\windows\system32\CC90FF60)
wb_gr.Close False
End Sub