+ Reply to Thread
Results 1 to 4 of 4

VBA Get File Attributes !!!!

  1. #1
    Registered User
    Join Date
    04-16-2015
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    40

    Exclamation VBA Get File Attributes !!!!

    Hi

    I am using the following formula to try and get file attributes on a shared drive. I am currently running into a few issues that I am wondering if I can get some guidance and or assistance in. The issues with the formula at the moment are:

    1. The formula is looping for a long time and is causing excel to crash in particular if it is reading more files (not more than 65000 as stipulated in the formula)
    2. At the moment the formula works fine if I am manually directing it to subfolders etc but if I point it towards a primary folder it crashes or takes a long time to return results. Is there a way I can perhaps try and speed up this process?

    The objective is to use this for Document Control purposes. I want to be able to run the code and be able to extract data in relation to the path, file name, format, last accessed and so forth. The results have to be returned in excel where I have a database that I am collating all of the information together.

    PS: THE BUTTON TO RUN THE CODE IS ON THE INTRO WORKSHEET TAB

    Code:
    Please Login or Register  to view this content.
    [/QUOTE]
    Attached Files Attached Files
    Last edited by QuintonMcCloud; 04-03-2017 at 09:19 AM. Reason: To Add Tags to the post

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA Get File Attributes !!!!

    Hi,

    Can you add code tags to your post please? We are not supposed to answer until you do so.

    By the way, the code in your question is not in your file.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    04-16-2015
    Location
    Scotland
    MS-Off Ver
    2007
    Posts
    40

    Re: VBA Get File Attributes !!!!

    Hi xInitwit

    Thank you for the heads up on this. Was not sure what you meant at first but I think I managed to insert tags into this post.

    I have also saved the file as a Macro- Enabled work book to ensure that when you are accessing it on your end it has the macro formula in the vba page.

    Cheers for that

    Q

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: VBA Get File Attributes !!!!

    I do not see any immediate bottlenecks although this part
    Please Login or Register  to view this content.
    does not need to be run for each file in the folder- and similarly in the recursive routine this part
    Please Login or Register  to view this content.
    especially as it has already been set properly using
    Please Login or Register  to view this content.
    It is possible there may be a faster API function that could be useful (API calls are usually 2-3 times faster than FSO in my experience) but I am unaware of which one might return the last 4 information items.
    Last edited by xlnitwit; 04-03-2017 at 09:48 AM.

+ 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. Macro to Get File Attributes
    By Brawnystaff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-25-2015, 07:12 PM
  2. File Attributes
    By sparx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-27-2015, 03:53 PM
  3. [SOLVED] Getting NTFS file attributes
    By Kiran in forum Excel General
    Replies: 1
    Last Post: 08-04-2005, 04:05 PM
  4. [SOLVED] More File Attributes needed
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-05-2005, 09:40 PM
  5. [SOLVED] File Attributes
    By mworthington@ntlworld.com in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-30-2005, 03:06 AM
  6. [SOLVED] Filecopy, file attributes
    By Eric in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2005, 10:06 AM
  7. File Attributes
    By dsti3 in forum Excel General
    Replies: 1
    Last Post: 02-10-2005, 02:06 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