Consulting

Results 1 to 4 of 4

Thread: Sharing An Excel Workbook

  1. #1
    VBAX Newbie
    Joined
    Apr 2008
    Posts
    3
    Location

    Sharing An Excel Workbook

    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

  2. #2

    Re:Sharing An Excel Workbook

    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.

  3. #3
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    Here is how i did it once

    [VBA]
    'unshare
    Application.DisplayAlerts = False
    ThisWorkbook.ExclusiveAccess
    Application.DisplayAlerts = True

    'Do stuff here

    're-share
    Application.DisplayAlerts = False
    ThisWorkbook.SaveAs , , , , , , xlShared
    Application.DisplayAlerts = True
    [/VBA]

    hope this helps

  4. #4
    VBAX Newbie
    Joined
    Apr 2008
    Posts
    3
    Location
    thanks for that... looks like exactly what i was after

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •