View Single Post
 
Old 06-26-2020, 06:48 AM
AntCTAZ AntCTAZ is offline Windows 10 Office 2019
Novice
 
Join Date: Mar 2020
Posts: 2
AntCTAZ is on a distinguished road
Default Excel VBA - Detect in Coauthoring Mode

Hello,

My company utilizes Excel Coauthoring using Office 365 and SharePoint. We also utilize an Excel Add-in full of macros I've created for the team. For one macro, I need it to only be able to be used when not in coauthoring mode. There were two ways I thought I could approach this:

(1) Somehow be able to detect if coauthoring is enabled; or
(2) Count the number of users currently in the coauthored Excel file.

I found and tried the VBA function UserStatus, however reading up on that, it seems to only work in a Shared workbook environment, not coauthored environment - with other people from my organization coauthoring an Excel workbook...

Users = ThisWorkbook.UserStatus
For usernum = 1 To UBound(Users, 1)
MsgBox Users(usernum, 1)
Next

only returned one user (me). I also tried this code for ActiveWorkbook instead of ThisWorkbook.

I did a lot of googling on how to tell if you're in coauthoring or count the number of activeusers, but couldn't find anything helpful.

Any help would be appreciated - Thank you!
Reply With Quote