Results 1 to 5 of 5

Make Workbook Read-Only and Not Saveable Upon Close

Threaded View

  1. #1
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Make Workbook Read-Only and Not Saveable Upon Close

    Hi all,

    I have the following procedure:
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
        Dim ws As Worksheet, shtCnt As Long, shtCntr As Long, thisBook As String
        thisBook = ActiveWorkbook.Name
        If ThisWorkbook.Name = "IPI Locater.xlsm" Then
            shtCnt = ThisWorkbook.Sheets.Count
            For shtCntr = 1 To shtCnt
                If Sheets(shtCntr).Name <> "Graphs" Then
                    Sheets(shtCntr).Visible = False
                End If
            Next shtCntr
        '''...More code that isn't necessary for this question...'''
    End Sub
    What I want to do if the workbook name is IPI Locater.xlsm is make it read only and also not give the user the ability to save the file. The reason for these criteria is because this particular file is going to be used on our corporate intranet and I need control over the workbook so that people will not be able to change the data in our department's shared drive. Any takers on this?

    Regards:
    Last edited by Mordred; 07-06-2011 at 07:40 PM.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1