Saving Files Opened as Read-Only

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.
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top