Results 1 to 6 of 6

Issue with Macro since Office 365 upgrade

Threaded View

  1. #1
    Registered User
    Join Date
    01-22-2020
    Location
    Midwest, USA
    MS-Off Ver
    Office 365
    Posts
    3

    Post Issue with Macro since Office 365 upgrade

    Hello! I have been dealing with this issue for some time now, hoping someone can help me out

    I have a set of workbooks that I refresh monthly. I took this over from someone else, who wrote the blue VBA code below. I believe the purpose of it is to only allow certain users to open and save the workbook, while forcing others to access it in read-only mode. I never had an issue doing this until recently when we upgraded from Office 2016 to Office 365. Now whenever I open the workbook I get the following error message:

    Run-time error '1004': Cannot access read-only document '[workbook url]'.

    When I select "debug", it jumps to the "User = UserStatus(1, 1)" line, which makes me think that my username [format is: "Doe, John (J.)"] is not being recognized. However, I can't tell why this is suddenly happening or how to fix it. I've tried searching for this issue but I cannot figure it out, so any and all help is greatly appreciated!

    Sub Workbook_Open()
    Dim User As Variant
    Dim UserStop As Integer
    Application.DisplayAlerts = False User = UserStatus(1, 1) UserStop = InStr(User, "(") - 2 User = Mid(User, 1, UserStop) If User = "Doe, John" Or User = "Doe, Jane" Then
    On Error Resume Next ThisWorkbook.LockServerFile
    Else
    ThisWorkbook.ChangeFileAccess Mode:=xlReadOnly
    End If Application.DisplayAlerts = True
    End Sub
    Last edited by Pepe Le Mokko; 01-22-2020 at 01:07 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Compile Error appears with upgrade to Office 2013 from Office 2010
    By MathUKTeacher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2019, 10:22 AM
  2. Macro not woking in Upgrade format of MS Office
    By Liju144 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2014, 12:40 AM
  3. Macro issue may have when upgrade excel from 2003 to 2013
    By lhollis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-30-2013, 03:21 AM
  4. Office 2010 upgrade
    By Spfsnana in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-17-2012, 10:28 AM
  5. New Macro error after Office Upgrade
    By Marc in forum Excel General
    Replies: 9
    Last Post: 03-03-2006, 05:15 PM
  6. [SOLVED] Excel Upgrade - Office XP
    By Lisa Beach in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 10-21-2005, 03:05 AM
  7. [SOLVED] Is it worthwhile to upgrade Office 2000 to Office 2003?
    By Tim Zych in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-26-2005, 03:06 PM

Tags for this Thread

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