+ Reply to Thread
Results 1 to 7 of 7

Files Fetching Details-Workbook Slow performance

  1. #1
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Files Fetching Details-Workbook Slow performance

    With the help of my my macro,

    I can able to perform all the things present in the Workbook.But i have some problem while executing.

    1.When Fetch i click fetch button i can able to retrieve the files from the folder and sub folder.But when clicking the Remove
    files from the directory i cant delete the empty folders present in the sub folders of the directory.

    2.When i click Retrieve empty files button i can able to retrieve the empty files list.But im not able to go back to the list of all
    files by creating Button which has fuction of remove filters.

    3.When i use Find Duplicates button the Workbook loading and closing immediately
    4.If Click Fetch Details button i can able to retrieve the files list..at that time my macro showing the Number of Files detail(In Green color)
    But When Filtering 0 KB files and Remove filter ..it cant change based on the files list present in the Worksheet column..


    Kindly Help me.

    Thanks,
    Laxman
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Files Fetching Details-Workbook Slow performance

    Does anyone have any idea about this ..pls help me to complete this..masters ..

  3. #3
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Files Fetching Details-Workbook Slow performance

    Bump no response..

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Files Fetching Details-Workbook Slow performance

    Hi laxman,

    I tried to make as few changes as possible, but sometimes the routines I was debugging required a complete rewrite. I can't post a file, because my Excel 2003 is not compatible with your newer version of Excel.

    One tip that should help you in the future.
    To prevent typos from ruining days and weeks of work 'Option Explicit' is NEEDED at the top of each code module. This prevents errors caused by missspellings and FORCES every variable to be DECLARED (e.g. dim i as Integer). http://www.cpearson.com/excel/DeclaringVariables.aspx

    1.When Fetch i click fetch button i can able to retrieve the files from the folder and sub folder.But when clicking the Remove files from the directory i cant delete the empty folders present in the sub folders of the directory.
    The problem was probably caused by 'rmdir'. It cannot delete a folder unless the folder contains NO files and No Subfolders. I rewrote zero() to use a slightly different approach. After zero() deletes all small files, it iterates through the folders until no more folders/subfolders can be deleted. There were several additional helper macros required.
    Please Login or Register  to view this content.



    2.When i click Retrieve empty files button i can able to retrieve the empty files list.But im not able to go back to the list of all files by creating Button which has function of remove filters.
    I added Sub ViewAllFiles() which turns the AutoFilter off. You have to add a new CommandButton to call the macro.
    Please Login or Register  to view this content.
    Broken into two parts due to ExcelForum size limitations.

    Lewis

  5. #5
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Files Fetching Details-Workbook Slow performance

    Post #4 continued:

    3.When i use Find Duplicates button the Workbook loading and closing immediately.
    cmdDuplicates_Click() - I did a complete rewrite to include addition of:
    a. processing only when data exists.
    b. turn AutoFilter off before processing.
    c. replace recorded macro code
    Please Login or Register  to view this content.
    4.If Click Fetch Details button i can able to retrieve the files list..at that time my macro showing the Number of Files detail(In Green color). But When Filtering 0 KB files and Remove filter ..it cant change based on the files list present in the Worksheet column.
    ClearResult() was rewritten to inlcude clearing of the counter that displays the file count.
    Please Login or Register  to view this content.
    Delete_0_Rows() was modified to count the number of deleted rows, and then adjust the counter that displays the file count.
    Please Login or Register  to view this content.
    Lewis

  6. #6
    Forum Contributor
    Join Date
    02-19-2014
    Location
    NJ
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Files Fetching Details-Workbook Slow performance

    Dear Lewis,

    Thanks for the expensive time and help..it's all working fine expected the below.

    1.When i click Retrieve empty files,Remove filters button it is showing the same count on the green button "Totla number of files".The count should be adjusted based on the selection.
    2.When i click "Delete 0KB files"button the files are not getting deleted from the directory and some times am getting error in the line of "Kill sPathAndFileName".

    Attaching the workbook which has the new code provided by you..

    Kindly help me on the same

    Kind Regards,
    Lax
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Files Fetching Details-Workbook Slow performance

    1.When i click Retrieve empty files,Remove filters button it is showing the same count on the green button "Total number of files". The count should be adjusted based on the selection.
    The following code from Module2 should fix the problem. I put the same code in 'ViewAllFiles()' also in Module2. You did not implement this which turns AutoFilter OFF ; a new CommandButton is required if you do implement this.
    Please Login or Register  to view this content.


    2.When i click "Delete 0KB files"button the files are not getting deleted from the directory and some times am getting error in the line of "Kill sPathAndFileName".
    This is a very difficult problem, because I can't duplicate the problem. I made changes in red to Sub zero(). This will help us find out what kind of error you are getting. It is possible that a file is already open to another program (and not allowed to be deleted) or you do not have delete access to the file, or the entire folder does not allow deletion. The runtime error you get will get us closer to an answer. When you get the error please let me know as much details as you can about them. I don't need to know about multiple errors with the same runtime error.

    Please Login or Register  to view this content.
    Lewis

+ 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. Slow Macro Performance When Modifying 1000s of excel files
    By alexkunec94 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-27-2013, 05:54 PM
  2. Row highlighting - Slow performance
    By Stroem in forum Excel General
    Replies: 2
    Last Post: 10-31-2012, 03:36 AM
  3. Replies: 4
    Last Post: 06-22-2011, 04:36 AM
  4. Fast then slow performance
    By Daniel Bonallack in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2006, 05:45 PM
  5. Very slow performance while exploring.
    By Gargoyl in forum Excel General
    Replies: 1
    Last Post: 04-24-2006, 03:51 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