Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Shared Workbook

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Shared Workbook

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.

John Pierce wrote:

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


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
shared workbook is set up is not 'shared' on network moviemaker novice Excel Worksheet Functions 0 April 7th 10 03:31 AM
shared workbook - shared workbook options grayed out Edward Letendre Excel Discussion (Misc queries) 0 March 3rd 10 10:47 PM
Shared Workbook - Slow opening of shared workbook. [email protected] Excel Programming 2 August 29th 07 05:14 PM
Printing viewing a shared workbook on a shared drive aloomba Excel Discussion (Misc queries) 0 April 13th 07 02:52 PM
update pivot in shared shared workbook 00George00 Excel Discussion (Misc queries) 1 August 23rd 06 08:16 PM


All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"