+ Reply to Thread
Results 1 to 2 of 2

Trying to run a simple automatic macro when file is protected and shared.

  1. #1
    Registered User
    Join Date
    02-23-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    2

    Trying to run a simple automatic macro when file is protected and shared.

    Hi All,

    I am having some trouble trying with macros; when my file is created it is sent out afterwards to be edited by certain individuals. These individuals need to be able to ungroup, grouped areas edit certain columns and most of the cells are locked, also this macro needs to run automatically when they open the file.. I have a macro which works to protect the sheets and fufill all of those reuirements, what i don't know how to do is then share and protect with track changes as well as a password and keep all of the features. This is the macro i currently use:

    Sub Workbook_open()
    For Each ws In Sheets
    With ws
    .Unprotect Password:="MyPassword"
    .Protect Password:="MyPassword", UserInterfaceOnly:=True
    .EnableOutlining = True
    End With
    Next ws
    End Sub

    Sub UnProtectAll()
    Dim wSheet As Worksheet
    Dim Pwd As String
    Pwd = InputBox("Enter your password to unprotect all worksheets", "Password")
    On Error Resume Next
    For Each wSheet In Worksheets
    wSheet.Unprotect Password:=Pwd
    Next wSheet
    If Err <> 0 Then
    MsgBox "You have entered an incorrect password. All worksheets could not " & _
    "be unprotected.", vbCritical, "Incorrect Password"
    End If
    On Error GoTo 0
    End Sub

    This is an essential peice of work and any assistance would be much appreciated.

    If this is not possible - is it possible to have all of this run and be able to track changes when they open the file?

    Many thanks.

  2. #2
    Registered User
    Join Date
    02-23-2015
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    2

    Re: Trying to run a simple automatic macro when file is protected and shared.

    *BUMP*

    Need help!!!!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. macro code for protected and shared worksheet
    By afbillah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2013, 03:41 PM
  2. VBA code to open protected shared file
    By Deredrum in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2013, 09:29 AM
  3. Macro run error in a shared & protected workbook
    By thuddleston11 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-05-2012, 01:53 PM
  4. Shared File Macro
    By sunten1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-14-2010, 07:45 PM
  5. Shared, Protected File with Filters?
    By BarryLCook1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2005, 10:49 AM

Tags for this Thread

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