PDA

View Full Version : Sharing An Excel Workbook



Ekka
04-20-2008, 07:41 PM
This question may already have been covered in another thread and I am sorry for bugging anyone but I have searched and I can't find it.

All I am after is some code to turn Share Workbook on and off. I have tried recording it but once you turn sharing on the recorder ends and it does not save any code in the Project.

I need it for a project I am working on and I am tryiny to automate a few things.

Thanks to anyone who can help :)

akanchu
04-20-2008, 08:30 PM
Hi Ekka,
you might want to try using :
ActiveWorkbook.MultiUserEditing
ActiveWorkbook.ExclusiveAccess
I have not tried this.

But I guess you cannot have a macro in a shared workbook. So you might not be able to implement both on the same workbook.

Thanks.

georgiboy
04-20-2008, 10:57 PM
Here is how i did it once


'unshare
Application.DisplayAlerts = False
ThisWorkbook.ExclusiveAccess
Application.DisplayAlerts = True

'Do stuff here

're-share
Application.DisplayAlerts = False
ThisWorkbook.SaveAs , , , , , , xlShared
Application.DisplayAlerts = True


hope this helps

Ekka
04-21-2008, 05:31 AM
thanks for that... looks like exactly what i was after :)