ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert a wokbook to shared mode (https://www.excelbanter.com/excel-programming/339773-convert-wokbook-shared-mode.html)

Don Rouse

Convert a wokbook to shared mode
 
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.
--
Don

Dave Peterson

Convert a wokbook to shared mode
 
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??????



Don Rouse wrote:

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.
--
Don


--

Dave Peterson

Don Rouse

Convert a wokbook to shared mode
 
Hi Dave,

Thank you for responding.

I stumbled onto the cause of the problem.

Note the extra "\" following "Project" in the path name below

\\Serverone\files\Projects\\Telular Corporation\1222-SX6P REWORK

Excel does not like that extra "\" when trying to share the workbook. I
removed the "\" and all is well.

Thanks again.

Don
--
Don


"Dave Peterson" wrote:

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??????



Don Rouse wrote:

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.
--
Don


--

Dave Peterson



All times are GMT +1. The time now is 08:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com