Unprotecting Question

E

EW

I have a file that is first shared and secondly each sheet is shared. What
I'm running into is the part of the code that makes the file unshared. This
is the code so far. Thanks for any help in advance....

ub Unprotect_All()

Dim fileToOpen As Variant
Dim ws As Worksheet
Dim Wbk As Workbook


fileToOpen = Application.GetOpenFilename("Excel Files (*.xls), *.xls")

Application.ScreenUpdating = False
ActiveWorkbook.ExclusiveAccess
For Each ws In Worksheets
ws.Unprotect
Next ws
Application.KeepChangeHistory = True
Application.SaveAs _
AccessMode:=xlShared
Application.ScreenUpdating = True

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