Results 1 to 13 of 13
  • Thread Tools
  1. sgerber
    #1
    Guest

    Read-only quandary

    I'm getting close to completing the template project I've been working on, and I'm faced with an interesting problem:

    I want to permit users to make some alterations to the template -- changing paragraph fonts, for example -- but not others, like changing the code.

    Is there a middle road I can take, something between rendering the template read-only and leaving it completely unprotected?

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 27 Times in 26 Posts

    Re: Read-only quandary

    Steve,

    You can lock the code project: in the VB Editor, in the Project Explorer window, right-click on the project name, then click on the popup menu item "[Project] Properties..."

    A "[Project] - Project Properties" dialog will appear; click on the Protection tab.
    Click a checkmark next to "Lock project for viewing" and then enter and confirm a password.

    The next time you re-open the template, you won't be able to view the code modules, without entering the password.
    This will similarly affect users, including if/when they were to (forfend!) get a run-time error message and clicked on the Debug button.

    Gary

  4. sgerber
    #3
    Guest

    Re: Read-only quandary

    >> A "[Project] - Project Properties" dialog will appear; click on the Protection tab.

    Click a checkmark next to "Lock project for viewing" and then enter and confirm a password.

    The next time you re-open the template, you won't be able to view the code modules, without entering the password.
    This will similarly affect users <<

    But users (and I) would still be allowed to make other kinds of changes -- fonts, etc. -- to the template?

  5. Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 27 Times in 26 Posts

    Re: Read-only quandary

    Yes.
    The locked project only affects access to the VBA code modules.

    BTW, what are the circumstances (if you don't mind elucidating) in which you don't mind the users mucking about with the templates? (or am I just reflecting the prejudices of my 'in-house developer' mindset?<g>)

  6. Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read-only quandary

    I'm with you, Gary, but you know that. I see red flags going up all over the place with users changeing ANYTHING in a production codebearing template. There are better ways.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  7. sgerber
    #6
    Guest

    Re: Read-only quandary

    >> Yes. The locked project only affects access to the VBA code modules. <<

    That's exactly what I needed to know, Gary. Thanks!

    >> BTW, what are the circumstances (if you don't mind elucidating) in which you don't mind the users mucking about with the templates? (or am I just reflecting the prejudices of my 'in-house developer' mindset?<g>) <<

    Yeah, you are. <returning g>

    The template I'm creating is for writing comic book scripts, and I'll be making it available from my website to any writer who wants it.

    For distribution purposes, I have to use the most common fonts -- Arial and Courier New, for example -- in the paragraph styles. But writers, being every bit as quirky and cantankerous as programmers, all have their individual preferences when it comes to things like the appearance of a script. (Heck, I don't even like Arial and Courier New. Arial is 'way overused, and Courier New prints like an old, worn typewriter ribbon, far too light.) I just want them to be able to indulge those preferences without wrecking the code.

    If I were developing the template for in-house use at a particular comics publisher, this wouldn't be a concern. Among other things, I could use whatever fonts I liked, secure in the knowledge that every employee would have that font on his or her computer.

  8. Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 27 Times in 26 Posts

    Re: Read-only quandary

    <<The template I'm creating is for writing comic book scripts, and I'll be making it available from my website to any writer who wants it.>>

    Well, I guess this does reflect on our blinkered, in-house developer mindset!
    Imagine, someone developing and distributing a template, for creative uses! <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15> <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

  9. Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read-only quandary

    Thanks for clarifying. Sounds like you are doing the best thing considering the situation. I'm curious about the template. Think I'll download and take a look. Thanks.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  10. Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read-only quandary

    Gary,

    Of course, that password can be compromised pretty easily. Not the best way to keep your code "yours", but it serves a purpose nonetheless.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  11. sgerber
    #10
    Guest

    Re: Read-only quandary

    >> Thanks for clarifying. Sounds like you are doing the best thing considering the situation. I'm curious about the template. Think I'll download and take a look. Thanks. <<

    I'll post a note here when it's done and maybe make a unlocked version available to the forum users, so they can take the code (and me) apart for what I'm sure are multiple and heinous VBA transgressions.

  12. Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Read-only quandary

    In anticipation, I'll be sharpening the barbs on my VBA-Infraction punishment tools...
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  13. sgerber
    #12
    Guest

    Re: Read-only quandary

    >> Well, I guess this does reflect on our blinkered, in-house developer mindset! Imagine, someone developing and distributing a template, for creative uses! <<

    Writing comics (and other stuff) is my real job. I originally put the template together just for my own use, back in the Word 6.0 era. Then I made the mistake of mentioning it somewhere online, and other writers began asking if they could try it out. That left me with two choices: either say "no," which seemed impolite, or actually figure out what I was doing.

    Woody, Eileen Wharmby, and a number of others from the WOPR forum's earlier incarnation on CompuServe were instrumental in helping me do the latter. You and Chris have been every bit as helpful this time around. I really can't tell you how grateful I am.

  14. sgerber
    #13
    Guest

    Re: Read-only quandary

    >> Of course, that password can be compromised pretty easily. Not the best way to keep your code "yours", but it serves a purpose nonetheless. <<

    Understood.

    Fortunately, most comic book writers aren't techie types and won't be tempted to muck with the code deliberately. As long as I can keep them from doing it accidentally, I'll be about 95% safe.

Posting Permissions

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