+ Reply to Thread
Results 1 to 4 of 4

Excel Timestamps (Not Working When Workbook Is Protected)

  1. #1
    Registered User
    Join Date
    06-04-2014
    Posts
    13

    Excel Timestamps (Not Working When Workbook Is Protected)

    Hi;

    I have a small problem with this time stamp I am using.

    When the worksheet is not protected the time stamp I am using works fine and enter's the time correctly as I want it to. Though when I lock the cells in column 3 and enter data into column 2, I am getting this error message.

    As you can see the first time it worked (when it wasn't protected), and the second time I locked column 3 and protected the worksheet and it did not work.

    http://s30.postimg.org/rlt1aquqp/Error.jpg

    This is the only code I am using as well;

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 2 Then
    Cells(Target.Row, 3).Value = Time
    End If
    End Sub

    Any help would be greatly appreciated.

    Regards;

    Andy
    Last edited by Anaky; 07-29-2014 at 01:44 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,199

    Re: Excel Timestamps (Not Working When Workbook Is Protected)

    Hi, Anaky,

    you should add code-tags to your procedure when showing it here on ExcelForum.

    You would need to unprotect the worksheet prior to writing and protect after the writing or use the parameter UserInterfaceOnly:=True and protect the sheet when opening the workbook.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    06-04-2014
    Posts
    13

    Re: Excel Timestamps (Not Working When Workbook Is Protected)

    Hi

    I believe I have done what you said but it gave me the same error. I'm not sure what to do using the parameter.

    I'm very new to excel also .

    I have uploaded the file here;

    https://www.sendspace.com/file/mhhsfj

    If this is OK for you to take a look at.

    Or any other simplified instructions to make sure I'm doing this correctly.

    Sorry, I will keep trying though!

    Thanks

  4. #4
    Registered User
    Join Date
    06-04-2014
    Posts
    13

    Re: Excel Timestamps (Not Working When Workbook Is Protected)

    Nvm I did it! TY very much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macros not working in a protected workbook
    By Triscia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2013, 08:25 AM
  2. Timestamps excel
    By excelvin in forum Excel General
    Replies: 1
    Last Post: 11-05-2012, 12:34 PM
  3. VBA Macro not working when workbook is protected
    By JustinMAS in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-24-2008, 04:58 PM
  4. Autofilter in protected workbook not working
    By Rumpa Biswas in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-27-2006, 12:35 PM
  5. Working with protected Databases Access through Excel
    By Dennis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2005, 06:05 PM

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