Strange Sorting in a Shared Wkbk

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
 
D

Dave Peterson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top