+ Reply to Thread
Results 1 to 3 of 3

Protecting the workbook for viewing vba code

  1. #1
    Registered User
    Join Date
    02-03-2017
    Location
    India
    MS-Off Ver
    2016
    Posts
    5

    Protecting the workbook for viewing vba code

    Hello all,
    Greetings!

    I need suggestions/help in my excel project.
    There's a part in my project where clicking on a CommandButton triggers a 'SaveAs' option for the end user and it generates a new file.
    And the user is forced to save the new file in .xlsx format. But my concern is, in new file the user will still be able to right click on the worksheet and view the VBA code thru 'View Code' option. I don't want end user to view the VBA code in that new sheet.

    Please suggest.
    Also let me know if I was not clear explaining my problem.


  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Protecting the workbook for viewing vba code

    This syntax saves the current file as xlsx without any VBA
    Display alerts supressed to prevent automatic message

    IMPORTANT - if fullPath is not a new file name this will overwrite file of same name in same folder

    Please Login or Register  to view this content.
    Last edited by kev_; 06-29-2017 at 10:43 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    02-03-2017
    Location
    India
    MS-Off Ver
    2016
    Posts
    5

    Re: Protecting the workbook for viewing vba code

    This really helped me. Thank you so much kev_

+ 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. Password Protecting Worksheet from Viewing
    By TWent in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 06-19-2019, 05:07 PM
  2. Password protecting the viewing of a single sheet
    By deegee in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-05-2013, 10:41 AM
  3. Stop from Viewing Workbook Code
    By jerryjaysr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2007, 08:36 PM
  4. [SOLVED] Does protecting a workbook shut off VBA code?
    By Stilla in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2006, 03:40 AM
  5. [SOLVED] Does protecting a workbook shut off VBA code?
    By Stilla in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-11-2006, 10:30 AM
  6. Does protecting a workbook shut off VBA code?
    By Stilla in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-11-2006, 10:25 AM
  7. [SOLVED] Protecting a VBA Project from viewing
    By William Benson in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-09-2005, 11:40 PM
  8. Protecting Sheet to Prevent Viewing At All
    By Michael Link in forum Excel General
    Replies: 9
    Last Post: 09-25-2005, 04:05 AM

Tags for this Thread

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