Yoko,
I've found a way to do what I think you want.
To share a workbook using vba use this code:
Code:
ActiveWorkbook.SaveAs FileName, , , , , , xlShared
Where 'FileName' is the path and name of your file. The file MUST be saved in order to enable sharing.
To unshare the workbook use this code:
Code:
If ActiveWorkbook.MultiUserEditing Then
ActiveWorkbook.ExclusiveAccess
End If
I would recommend saving the file as well immediately after changing it from Shared to unshared:
Code:
ActiveWorkbook.SaveAs FileName
Hope this works for you.
Take Care.
Owen