Saving Files Opened as Read-Only

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can an Excel file opened as read-only be made read-write while it is open ? Preferably through VBA

In Lotus 1-2-3 there was an option to open a file "without reservation" making it read-only. After making edits the reservation could be requested & if the file hadn't changed & no one had reservation the file was changed to read-write access & could be saved as the original file name

I'm not real familiar with the share feature of Excel but it looks like it leaves the door open to losing edits.
 
How was the file marked readonly?

Via the OS?
Or File|SaveAs|Tools|General Options|Readonly Recommended
or File|open|(open readonly)

If it's readonly from the OS, this seemed to work ok (win98):

Option Explicit
Sub testme()

With ActiveWorkbook
SetAttr .FullName, vbNormal
.ChangeFileAccess xlReadWrite
End With

End Sub

if it was from readonly recommended or just opened readonly, I didn't need the
setattr line:

Option Explicit
Sub testme()

With ActiveWorkbook
.ChangeFileAccess xlReadWrite
End With

End Sub
 
Back
Top