Convert a wokbook to shared mode

G

Guest

I have shared workbooks. My code can unshare the workbook to unprotect
sheets and add named ranges. But I cannot convert the workbook back to
shared mode.

Can you help?

Here is the code I have written to put the workbook back into shared mode,
but it doesn't work. What am I doiung wrong?

With ActiveWorkbook
.KeepChangeHistory = True
.ChangeHistoryDuration = 1
End With
ActiveWorkbook.SaveAs Filename:= _
myProjectFolder & myProject , AccessMode:=xlShared
ActiveWindow.Close

Thank you for your assistance.
 
D

Dave Peterson

Your code worked fine for me in my tests:

Option Explicit
Sub testme()

Dim myProjectFolder As String
Dim myProject As String

myProject = "book99.xls"
myProjectFolder = "C:\my documents\excel\"

With ActiveWorkbook
.KeepChangeHistory = True
.ChangeHistoryDuration = 1

.SaveAs Filename:= _
myProjectFolder & myProject, AccessMode:=xlShared
End With
End Sub

Are you sure your variables point at the correct names/locations?

Is the correct workbook active?

What happens when you run your code--error messages??????
 

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