+ Reply to Thread
Results 1 to 8 of 8

VBA code does not work on shared workbook

  1. #1
    Registered User
    Join Date
    07-07-2015
    Location
    Israel
    MS-Off Ver
    2010
    Posts
    20

    VBA code does not work on shared workbook

    Hi,

    I have a VBA code that works perfect when workbook not shared!!!

    How can I fix it to work on shared workbook?


    Thanks a lot!!!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,447

    Re: VBA code does not work on shared workbook

    Hi den,

    If you mean "shared" is the workbook is one OneDrive and two people are working on it, you are using Excel Online. Excel Online is looking at a browser view of the data and VBA doesn't work through a browser. You will need to download the workbook to each individual computer to have the VBA work. Then you aren't sharing it. Excel Online doesn't support VBA. It seems you can edit the data that is shared but the VBA doesn't work. Read:
    https://blogs.office.com/2014/04/14/...in-april-2014/
    Last edited by MarvinP; 03-16-2017 at 06:49 AM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    07-07-2015
    Location
    Israel
    MS-Off Ver
    2010
    Posts
    20

    Re: VBA code does not work on shared workbook

    Hi Marvin,

    Thank you for you response.

    That what I am talking about:Share Workbook.PNG

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA code does not work on shared workbook

    There is a list of all the features that do not work in Shared Workbooks here- https://support.office.com/en-us/art...ad=US&fromAR=1
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Registered User
    Join Date
    07-07-2015
    Location
    Israel
    MS-Off Ver
    2010
    Posts
    20

    Re: VBA code does not work on shared workbook

    The code is should to put back My List (Located in K3:K7) when a set of cells cut:
    Private Sub Worksheet_Change(ByVal Target As Range)
    On Error Resume Next

    Dim MyList(5) As String
    MyList(0) = 10
    MyList(1) = 2
    MyList(2) = 3
    MyList(3) = 4
    MyList(4) = 5
    MyList(5) = 6

    With Range("k3:k7").Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, _
    Operator:=xlBetween, Formula1:=Join(MyList, ",")
    End With

    End Sub

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA code does not work on shared workbook

    As listed in the article, in a shared workbook you cannot add or change data validation. You have to unshare the workbook if you need to do that.

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,447

    Re: VBA code does not work on shared workbook

    I stand corrected, in that VBA may be allowed in shared workbooks. It just seems you can only do "allowed" things with your VBA.

    I find a good and long discussion of shared workbooks at:
    http://blog.contextures.com/archives...ooks-in-excel/

  8. #8
    Registered User
    Join Date
    07-07-2015
    Location
    Israel
    MS-Off Ver
    2010
    Posts
    20

    Re: VBA code does not work on shared workbook

    Thank you all

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Timestamp Doesn't Work When Workbook Is Shared
    By Anaky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-19-2014, 10:27 AM
  2. Replies: 2
    Last Post: 04-17-2014, 09:41 PM
  3. Replies: 0
    Last Post: 09-18-2012, 11:24 AM
  4. Custom Sort Macro Doesnt work when workbook is shared
    By vaznlyfe in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2012, 10:23 PM
  5. shared workbook, saving work my multiple users
    By obeo2k2 in forum Excel General
    Replies: 2
    Last Post: 08-03-2011, 06:29 AM
  6. Deleting activesheets won't work in a shared workbook
    By Christian411 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2009, 03:26 PM
  7. Shared Workbook (Workbook Open Code)
    By Chard in forum Excel General
    Replies: 5
    Last Post: 05-30-2007, 09:04 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1