+ Reply to Thread
Results 1 to 15 of 15

Error 92.For loop not initialized

  1. #1
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Error 92.For loop not initialized

    Hi

    In one of my Dictator Excel Applications. I am encountering the "Error 92, For loop not initialized" error.The Error does not let the workbook opened with any sheet. It just shows a blank instance of Excel (Snap attached).For some reasons I am unable to attach the workbook for some reasons. Although I am sharing the Workbook_open() Code as it shows the error on opening.May some suggestions/solutions be provided with out the book attached?
    whats wrong with the code bellow:

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by ImranBhatti; 01-09-2018 at 12:40 PM.
    Teach me Excel VBA

  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: Error 92.For loop not initialized

    Hi

    Have you trusted access to the VBA project in the trust centre?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Error 92.For loop not initialized

    Sir the "Trust Access to the VBA Project to object Model" is ticked.

  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: Error 92.For loop not initialized

    Perhaps the issue is related to the fact that your product activation of Excel seems to have failed on that computer.

  5. #5
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Error 92.For loop not initialized

    The Microsoft Office Activation wizard does pop up for every instance of Excel but other files have no issue.

  6. #6
    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: Error 92.For loop not initialized

    Do the other files have the same code in?

  7. #7
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Error 92.For loop not initialized

    I am confirming the code equality of the file with others.

  8. #8
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Error 92.For loop not initialized

    Yes the code is same for all books.

  9. #9
    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: Error 92.For loop not initialized

    Are you sure the error is in that code? If so, on which line?

    The code itself is, in my opinion, hard to follow due to the large number of redundant commented out lines, and also contains a fair amount of seemingly pointless code (e.g. enabling events from a Workbook_open event which wouldn't be running if events were not enabled). Furthermore, assuming that code is in an add-in, there does not appear to be an active workbook- something to which it refers frequently.

  10. #10
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Error 92.For loop not initialized

    I have tested and now make the lines as red in the first post. The error message pops up as it is concatenated in the error handler(Red lines).
    And the last line that executes before reaching to message box is also red above.

  11. #11
    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: Error 92.For loop not initialized

    I don't see how you could get to the red line, if the For loop (which precedes it) is in error. Is there any event code in the DataValues sheet?

  12. #12
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Error 92.For loop not initialized

    Yes
    The "DataValues" sheet has the following code
    Please Login or Register  to view this content.

  13. #13
    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: Error 92.For loop not initialized

    I honestly cannot see anything in the code that is incorrect, so I'm afraid the onus is on you to do some debugging since you have the actual workbook in front of you.

  14. #14
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Error 92.For loop not initialized

    Yes I understand that it is too difficult to help by looking a piece of code of a large application.I will try to debug it as prescribed and let you know the come outs.

    Thanks a lot for trying so hard to help out.

    Best Regards
    Imran Bhatti

  15. #15
    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: Error 92.For loop not initialized

    If you can provide the workbook, I will try and help further but I realise that may not be an option.

+ 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] "For Loop Not Initialized" Error
    By SoothSailor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2014, 12:27 PM
  2. HOW TO: Pause loop, fix error on a popup UserForm, continue loop
    By AndyMachin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-19-2014, 04:37 PM
  3. Error 92: For loop not initialized...how to fix?
    By excelspud in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-01-2011, 09:55 PM
  4. Error 92: For Loop Not Initialized - It worked before??
    By djdave022002 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-17-2011, 09:14 AM
  5. Excel 2007 : How to re-initialized column
    By learning_excel007 in forum Excel General
    Replies: 2
    Last Post: 04-15-2010, 10:53 PM
  6. [SOLVED] How does Userform get initialized by this?
    By RB Smissaert in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2005, 01:50 PM
  7. Form Initialized
    By ceemo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-30-2005, 02:37 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