+ Reply to Thread
Results 1 to 4 of 4

Need VBA code to make an excel sheet read only in an excel workbook

Hybrid View

Nanimadhu Need VBA code to make an... 03-01-2014, 02:11 AM
ajryan88 Re: Need VBA code to make an... 03-01-2014, 02:33 AM
Nanimadhu Re: Need VBA code to make an... 03-01-2014, 04:58 AM
HaHoBe Re: Need VBA code to make an... 03-01-2014, 05:43 AM
  1. #1
    Registered User
    Join Date
    12-31-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Need VBA code to make an excel sheet read only in an excel workbook

    Hi Experts,
    Please help me writting VBA code to open an excel sheet of a workbook in Read-only mode.
    Lets say. Book1 is the excel workbook, which has spreadsheets Sheet1, Sheet2 and Sheet3. I want Sheet2 should be Read-only everytime when i run macro.
    Please help.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Need VBA code to make an excel sheet read only in an excel workbook

    Hi,

    Have you thought of just protecting the worksheet?
    Worksheets("Sheet2").Protect
    I hope this helps

  3. #3
    Registered User
    Join Date
    12-31-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Need VBA code to make an excel sheet read only in an excel workbook

    Actually, Book1 is in Shared mode.
    Could you please help, because in shared mode sheet cannot be protected. Thats why, i'm looking for read-only mode of a perticular sheet.

  4. #4
    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,198

    Re: Need VBA code to make an excel sheet read only in an excel workbook

    Hi, Nanimadhu,

    I think it´s the same for every workbook whether shared or not: it´s either read-only or not for all the worksheets inside. Maybe consider splitting the workbook up into different ones.

    In a normal workbook it should be possible to switch between the states although at present I can´t figure a reason to do so.

    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

+ 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. Any Way to make an Excel sheet automatically open any linked file as read only?
    By JonBiegen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-11-2013, 06:41 PM
  2. update excel sheet and read the forumla to make the changes
    By luannc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-21-2011, 01:07 PM
  3. Replies: 2
    Last Post: 09-17-2010, 02:01 PM
  4. Replies: 4
    Last Post: 04-26-2007, 02:13 AM
  5. [SOLVED] Read out VBA code from a damaget excel.xls workbook.
    By Øyvind in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2005, 09:05 AM

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