Dave Peterson said:
In general, macros should work in shared workbook--if the user allows
macros to
run(!).
But maybe your macros are trying to do illegal stuff in that shared
workbook and
you're masking the error--so it looks like they're not working?
on error resume next
activesheet.unprotect password:="hi"
would look like it didn't run.
Hmm, I understand. And looking over this again, I may be doing something
"illegal" in terms of the macro code. Here are all the macros in the sheet:
*************************************************************
Sub AddNEWentry_NO_SORT()
'
Cells(ActiveCell.Row, "B").Select 'this extra row for better
worksheet view
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
End Sub
Sub AddNEWentry_SortINVOICElog()
'
ActiveSheet.Unprotect 'place at the beginning of the code
Application.Goto Reference:="R1C1"
'----------------------------------------------------------------------------------
' SORTING section of code:
Selection.SORT Key1:=Range("D2"), Order1:=xlAscending, Key2:=Range("B2")
_
, Order2:=xlAscending, Key3:=Range("A2"), Order3:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom
Selection.SORT Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
'----------------------------------------------------------------------------------
Cells(ActiveCell.Row, "B").Select 'this extra row for better
worksheet view
Range("A1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select
ActiveSheet.Protect 'place at the end of the code
End Sub
Sub GoToBeginningOfRow()
ActiveSheet.Unprotect 'place at the beginning of the code
Cells(ActiveCell.Row, "B").Select 'this extra row for better
worksheet view
Cells(ActiveCell.Row, "A").Select
' Re-protects sheet in case anything unprotects it, yet allows vb
functioning to remain.
With ActiveSheet
.Protect UserInterfaceOnly:=True
End With
ActiveSheet.Protect 'place at the end of the code
End Sub
*************************************************************
I get the error:
"Run-time error '1004':
Unprotect method of Worksheet class failed."
I hadn't seen the reference to "unprotect" earlier. I guess XL doesn't like
to unprotect shared workbooks? But if we don't unprotect, the sort won't
happen and users can really screw up the workbook, too.
Anyway, are there any solutions?
Thanks!
D