Strange Sorting in a Shared Wkbk

  • Thread starter Thread starter Ken Smith
  • Start date Start date
K

Ken Smith

XL2000 SR-1 on Win2K SP3. Strange behaviour sorting a list
from the menu or via code in a shared wkbk. Standard
rectangular list with headers (say A1:D50) without empty
rows/cols. Unshared wkbk = everything normal. Shared wkbk
= try sorting from the data menu, xl selects A2:IV50. With
activecell A1 - Edit/Goto/Special/Currentregion works
normally. Code to sort Range("A1").Currentregion... sorts
A1:IV50.

Also - any way to toggle sharing via code to update pivot
tables, sort (given above problem), etc?

Any ideas? Thanks,
Ken Smith
 
The only guess I have for your first point is that's the way excel works. If
you're going to use shared workbooks, you may want to put different tables in
different rows or worksheets.

And if you're willing to lose "sharedness", this worked for me. (As a single
user on a home pc. The workbook was shared, but not with anyone else)

Option Explicit
Sub shareme()
ActiveWorkbook.KeepChangeHistory = True
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs AccessMode:=xlShared
Application.DisplayAlerts = True
End Sub
Sub unshareme()
Application.DisplayAlerts = False
ActiveWorkbook.ExclusiveAccess
Application.DisplayAlerts = True
End Sub

I recorded a macro when I did it, but I started recording in a different
workbook.
 
Back
Top