Shared Workbook

J

John Pierce

What is it about this little bit of code that makes it give Error 1004
when the Workbook is shared but it works fine when the wb is not
shared?

Private Sub SaveRecord()

ActiveWorkbook.Save
LocateFirstEmptyRow
On Error GoTo ErrorHandler

ActiveSheet.Unprotect

With ActiveCell
.Value = cmbIndividuals
.Offset(0, 1).Value = cmbManagers
.Offset(0, 2).Value = cmbTeams
End With

ErrorHandler:
ActiveWorkbook.Save
LocateFirstEmptyRow

End Sub

Public Sub LocateFirstEmptyRow()
Range("B65536").Select
Selection.End(xlUp).Select
ActiveCell.Offset(1, 0).Range("A1").Activate
End Sub
 
D

Dave Peterson

You can't change protection of a worksheet in a shared workbook.

There are lots of things that are unavailable in shared workbooks. Excel's help
(not VBA) has a list.
 

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