+ Reply to Thread
Results 1 to 3 of 3

Creating a Read Only Directory - VBA

  1. #1
    Forum Contributor
    Join Date
    08-22-2017
    Location
    USA
    MS-Off Ver
    2016 WINDOWS and MAC
    Posts
    294

    Creating a Read Only Directory - VBA

    Hi,

    In short:

    My macro allows for editing a "database entry". On creation of a new entry, a directory is created to store files at the root of the .XLSM file. Then other sub directories are created. All files (attachments) are uploaded via a userform.

    The user will have the choice to view the explorer window of the directory by a button click in the userform, but I would only like it to be read only. So they can't modify. However, my VBA code needs to be able to modify (add, delete, rename) files within the directory.

    A good point: it doesnt necessarily have to be read only. I just want them to click the button, see the files in the folder, but not be able to modify.

    Any tips?

    Thanks for all the help, folks!!!

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    Re: Creating a Read Only Directory - VBA

    Hi there,

    If you want a User to be able to view the list of files contained in a folder (without being able to open any of those files) you could use the following code:

    Please Login or Register  to view this content.
    I'm assuming that the filenames you want to view are those of Excel files, but if not, just change the value of the FileFilter to suit.

    I've also assumed that you want to start searching from the folder which contains the workbook which contains this code - if not, just change the starting-point to suit your own requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files
    Last edited by Greg M; 07-23-2018 at 07:35 AM. Reason: Correct attachment added

  3. #3
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641

    Re: Creating a Read Only Directory - VBA

    Hi again,

    Many thanks for the Reputation increase - much appreciated

    Best regards,

    Greg M

+ 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. [SOLVED] Creating sub directory.
    By gsandy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2017, 03:22 PM
  2. VBA read all Excel files in a directory then parse through each
    By kpierce in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2012, 11:52 AM
  3. macro to read names of subfolders in a directory
    By michael.steffensen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2012, 09:21 AM
  4. Copy files to directory, mark read only -r
    By Mitch_McComb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2009, 02:40 PM
  5. Creating a directory
    By justchris in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-01-2006, 10:19 PM
  6. Creating a directory
    By Graham Whitehead in forum Excel General
    Replies: 1
    Last Post: 06-22-2006, 08:50 AM
  7. read all the files after choosing a directory
    By M H in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-11-2005, 12: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