Solved

VBA Excel 2000 - Remove Sharing

Posted on 2011-03-25
3
223 Views
Last Modified: 2012-05-11
Dear Experts,

I would like to remove share by VBA code, so the same which would be done through menu Tools/Share Workbook and removing the flag in section "All changes by more than one user..."

The macro record would do this with a single line

    ActiveWorkbook.ExclusiveAccess

but the problem it brings error message if the file is not shared originally.

Could you please advise how a check could be before this line whether the workbook is shared or not?

thanks,
0
Comment
Question by:csehz
  • 2
3 Comments
 
LVL 30

Assisted Solution

by:SiddharthRout
SiddharthRout earned 500 total points
Comment Utility
The simplest way to do it is

On Error Resume Next
ActiveWorkbook.ExclusiveAccess
On Error GoTo 0

Sid
0
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 500 total points
Comment Utility
If you want to do a proper check then use this

If ActiveWorkbook.MultiUserEditing Then
    ActiveWorkbook.ExclusiveAccess
End If

Open in new window


Sid
0
 
LVL 1

Author Closing Comment

by:csehz
Comment Utility
Sid thanks very much for both
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now