Results 1 to 3 of 3

Shared and Protected Workbook

Threaded View

  1. #1
    Registered User
    Join Date
    08-12-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    17

    Shared and Protected Workbook

    Hi,

    I am runinng the code below on a protected worksheet and it runs fine. However when I also add the shared workbook feature there is an error in the code. The system is going to be used by multiple users so it needs to be shared and protected. I have tried using Worksheets("Master").UnprotectSharing to work round this but it doesn't seem to work. Could anyone offer some advice?

    Private Sub submitOrder_Click()
    
    Dim valid As Boolean
    Dim dateToday As Date
    
    'Unprotect spreadsheet
    Worksheets("Master").Unprotect ("fx")
    
        'Find the last row
        Row = Range("A65536").End(xlUp).Row
        Row = Row + 1
    
        'Populate next row
        Worksheets("Master").Cells(Row, 1).Value = customerInput.Value
        Worksheets("Master").Cells(Row, 2).Value = currencyPair.Value
        Worksheets("Master").Cells(Row, 3).Value = direction.Value
        Worksheets("Master").Cells(Row, 4).Value = amount.Value
        Worksheets("Master").Cells(Row, 5).Value = fixType.Value
        Worksheets("Master").Cells(Row, 6).Value = todayDate.Value
        Worksheets("Master").Cells(Row, 7).Value = fixTime.Value
        Worksheets("Master").Cells(Row, 8).Value = dealer.Value
        
        'Change colour of cell and put placed in confirmed order
        Worksheets("Master").Cells(Row, 9) = "Placed" 'Put Placed in cell
        Worksheets("Master").Cells(Row, 9).Interior.ColorIndex = 15 'Change colour of cell
    
        'Close form
        Unload Me
    
        'Save spreadsheet
        'ActiveWorkbook.Save
        
        'Protect spreadsheet
        Worksheets("Master").Protect ("fx")
        
    
    End If
    
    End Sub
    Last edited by Mordred; 08-18-2011 at 11:09 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1