+ Reply to Thread
Results 1 to 11 of 11

error Progress bar

  1. #1
    Registered User
    Join Date
    10-07-2011
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    54

    error Progress bar

    Hello, I have a code to import data fron text file and I want to add progress bar to monitor it. My problem is when I run the code with progress bar there is some error occures. Anyhelp would be appreciated. Thanks,

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: error Progress bar

    Hi,

    Could you upload a workbook with the progress bar and at least one file that you would normally import? It doesn't have to contain any real data, but just any mocked up data to reflect the true workings of the process.

    Also what error message are you getting and which line does it stop at?

    abousetta
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: error Progress bar

    What sort of errors?

    You really need to post example workbook so we can see how you have setup the progress userform. Also an example of the import file would help if that is related to the error.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    10-07-2011
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: error Progress bar

    Thanks for your anwers,

    Please find attached the problem I have. I get "invalid property value" after running a code.

    thanks,
    Attached Files Attached Files

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: error Progress bar

    First problem is you have set the max to 2000 but the i variable exceeds this.
    I'm also getting lots of Out of Memory warnings but I'm not sure what is causing that.

  6. #6
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: error Progress bar

    I was thinking the same thing as Andy (I am honored to be on the same wavelength with such a well-know Guru). Your largest i is 5822. So you might want to make the maximum a bit a higher. For example:
    Please Login or Register  to view this content.
    abousetta

    P.S. Not getting any Out of Memory Errors, so can't guess as to why this is happening also.

  7. #7
    Registered User
    Join Date
    10-07-2011
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: error Progress bar

    If it's possible to set "Progressbar.ProgressBar1.Max = " to finish at the same time with the code. I need to import data from different text files so the time to upload data is not the same.

    thanks,

  8. #8
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: error Progress bar

    It is possible. The problem seems to be that the last part of the file is irrelevant to your import. For example the full length of the document is about 7500 lines but your "i" is only around 5900. What happens if I use the length of the file is that the progress bar progresses normally but then ends early because the last quarter is run extremely quickly. On the other hand, I tried to calculate the final number of "i" but now this is less than the length of the text file.

    So I am out of ideas... sorry.

    abousetta

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: error Progress bar

    This approach, using standard I/O, will allow you to determine size and position within the file being processed.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-07-2011
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: error Progress bar

    Thank you all for kind help and valuable time.

    @abousetta, thank you very much for your answer

    @Andy Pope, thank you very much for the nice code. It works like a charm.

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: error Progress bar

    @copythat, if you are satisfied with the responses then please mark the thread as Solved.

    Good luck.

    abousetta

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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