Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove Sharing Code Error
I have hundreds of Excel files that are currently set as "shared" but I want
to remove this feature. I tried to create code to do this by recording the action of me unsharing one workbook. This produces the code: ThisWorkbook.ExclusiveAccess I then added Application.DisplayAlerts = False before the line above and Application.DisplayAlerts = True after the line above to produce the following. I did this because there is a message box that pops up when you unshare in Excel warning about various things. I wanted to skip this. Application.DisplayAlerts = False ThisWorkbook.ExclusiveAccess Application.DisplayAlerts = True When I run this I get an error though. The error is: Run-Time error '1004': Method 'ExclusiveAccess' of object '_Workbook' failed End/Debug/Help etc.... Can anyone suggest why I am getting this error message or how I can alter my code to unshare a workbook without getting an error? Many thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sharing a workbook breaks VBA code? | Excel Programming | |||
How do I remove protection and sharing from an Excel workbook? | Excel Discussion (Misc queries) | |||
After sharing workbook VB code stops working. Runtime Error 1004 | Excel Programming | |||
Sharing Error | Excel Discussion (Misc queries) | |||
Programmatically remove sharing? | Excel Programming |