With Tables("进库表") If .Current IsNot Nothing Then .Current.Locked = True For Each r As Row In Tables("库表.进库明细表").Rows r.Locked = True Next End IfEnd With