Results 1 to 3 of 3

unshare and unprotect the workbook using one button

Threaded View

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    london
    MS-Off Ver
    Excel 2002
    Posts
    49

    unshare and unprotect the workbook using one button

    I am trying to unshare and unprotect the workbook using one button.
    I'm confused to which loop statement I shoud be using..any ideas?

    see my code below

    Private Sub CommandButton1_Click()
    
    If ActiveWorkbook.MultiUserEditing Then
            Application.DisplayAlerts = False
            ActiveWorkbook.ExclusiveAccess
            Application.DisplayAlerts = True
    
    If Not ActiveWorkbook.MultiUserEditing Then
            Application.DisplayAlerts = False
            ActiveWorkbook.SaveAs ActiveWorkbook.Name, accessmode:=xlShared
            Application.DisplayAlerts = True
            
    ??
    
    ActiveSheet.Unprotect Password:="123", UserInterfaceOnly:=True
    
    End If
    
    End sub
    Last edited by JBeaucaire; 07-29-2013 at 10:12 AM. Reason: Added CODE tags and corrected title, as per Forum Rules. Take a moment to read the Forum Rules in the menu bar above. Thank

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unable to UNSHARE a Workbook
    By PosseJohn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2013, 12:36 PM
  2. Unshare a workbook
    By displaced in forum Excel General
    Replies: 0
    Last Post: 08-26-2009, 10:25 AM
  3. Can't unshare workbook
    By TUSSFC in forum Excel General
    Replies: 1
    Last Post: 05-20-2009, 10:24 AM
  4. how to unshare a workbook?
    By Todd in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 07:05 PM
  5. how to unshare a workbook?
    By Todd in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-07-2005, 07:06 PM

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