+ Reply to Thread
Results 1 to 5 of 5

Disable read-only property of a workbook

  1. #1
    Registered User
    Join Date
    11-23-2007
    Posts
    65

    Disable read-only property of a workbook

    Hi guys,

    I have a macro that I run which captures data. It then opens up another workbook with the intent of writing this information to it. Opening the secondary workbook in my code isn't the problem. The problem is I have the secondary workbook set as read-only (there is a reason for this). I want my macro to temporarily disable the read-only property, write to the file, and then turn the read-only property back on.

    Any ideas on how I do this?

    Thanks,

    Chris

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Disable read-only property of a workbook

    Do you mean that the workbook was saved with the Read Only Recommended option set?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    11-23-2007
    Posts
    65

    Re: Disable read-only property of a workbook

    No, I set the read-only property by right clicking on it, selecting general options, and then ticking the 'read-only' box.

    I do this because when users open this secondary file I only want them to be able to view the information - I don't want them to have the option of writing to it. The writing of information to this file is to be done purely by the macro I've written in the primary spreadsheet.

    Hope that makes sense!

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Disable read-only property of a workbook

    Check out VBA's SetAttr statement then. It will allow you to turn that off then turn it back on again afterwards.

  5. #5
    Registered User
    Join Date
    11-23-2007
    Posts
    65

    Re: Disable read-only property of a workbook

    Excellent - sorted!

    Thanks very much for your help!

    Chris

+ Reply to Thread

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