Share via

Refreshing Read Only Sheets

Anonymous
2014-08-06T16:19:47+00:00

Hello,

I like to review other spreadsheets people work in as read-only.  Is there a VBA which allows me to “refresh” the file by closing it & then opening again in ready only?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2014-08-07T14:38:38+00:00

    Just comment out the "If .ReadOnly Then Exit Sub" line.  Now the routine will work for all files.

    Eric

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2014-08-07T14:36:14+00:00

    The VBA only seems to work if I have a file only in writing mode.  Its really if I have a file open as read only.  I'd to close & re-open it again as read-only giving it a "refresh" in case someone made edits in the file.

    Was this answer helpful?

    0 comments No comments
  3. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2014-08-07T13:34:32+00:00

    Add the code below to your PERSONAL.XLSB or an AddIn.

    Andreas.

    Sub ReOpenReadOnly()

      Dim Fullname As String

      With ActiveWorkbook

        'New file?

        If .Path = "" Then Exit Sub

        'Already readonly?

        If .ReadOnly Then Exit Sub

        'Save the path\file name of the current file

        Fullname = .Fullname

        'Close it, ignore changes

        .Close False

      End With

      'ReOpen readonly

      Workbooks.Open Fullname, ReadOnly:=True

    End Sub

    Was this answer helpful?

    0 comments No comments