Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9054597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:43:42+00:00 2026-06-16T13:43:42+00:00

A serious scenario I have encountered and which is totally made my Script handicapped,

  • 0

A serious scenario I have encountered and which is totally made my Script handicapped, which is as below:

On Error Resume Next

For IndexSearch = 0 To ArrayListTaskDetails.Count - 1 Step 4

    If ArrayListTaskDetails(IndexSearch + 5) <> "" Then

        ArrayListTaskDetails(IndexSearch + 2) = ArrayListTaskDetails(IndexSearch + 5)

    'Else

        'ArrayListTaskDetails(IndexSearch + 2) = DicForProcessEndDate.Item(ob9.Cells(RowCount,1))

    End If 

Next

If Err Then

    Err.Clear
    MsgBox(IndexSearch) '4
    ArrayListTaskDetails(IndexSearch + 2) = DicForProcessEndDate.Item(ob9.Cells(RowCount,1))
    MsgBox(ob9.Cells(RowCount,1)) '47166954
    MsgBox(DicForProcessEndDate.Item(47166954)) ' here i am getting its value
    MsgBox(DicForProcessEndDate.Item(ob9.Cells(RowCount,1))) ' here i didn't see any value for the key ob9.Cells(RowCount,1). Even "47166954" and ob9.Cells(RowCount,1) are same

End If

On Error GoTo 0

Could you help me to understand what the issue is? If it really an issue and help me to resolve it by changing the approach here.

EDIT

When an error occurs as Array out of range from the line If ArrayListTaskDetails(IndexSearch + 5) <> "" the control goes to error handling part,That’s perfect but the IndexSearch count is increased by 4. Lets say when IndexSearch = 0,then an exception raised and in the Exception block I am getting IndexSearch value as for 4 not, 0 — why so? please tell me!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:43:44+00:00Added an answer on June 16, 2026 at 1:43 pm

    It is likely that ob9.Cells(RowCount,1) is returning a string value.

    When you try MsgBox(DicForProcessEndDate.Item(47166954)) You have hard-coded a numeric value for the key passed to DicForProcessEndDate.

    The Dictionary Object’s key property considers 47166954 and "47166954" to be different values. This makes sense because one is numeric and the other is a string.

    To avoid your issue, you can convert your key to a numeric value by wrapping it in Clng(). Like so:

    MsgBox(DicForProcessEndDate.Item(clng(ob9.Cells(RowCount,1))))
    

    Alternately, if you wanted to use the string value you could use Cstr()


    Edit: In response to your second question:

    You are making an invalid assumption. VBScript error trapping does not work the same as Excel VBA. Specifically, you cannot do something like On Error goto ErrorCorrection.

    Because of the line On Error Resume Next your for loop will continue regardless of whether an error has occurred.

    If you want to halt the for loop, like you implied you will need to update your logic to something like this:

    For IndexSearch = 0 To ArrayListTaskDetails.Count - 1 Step 4
        If ArrayListTaskDetails(IndexSearch + 5) <> "" Then
            'Check to see if proceeding line caused an error
            If err then
                'Clear the error
                err.clear
                'Exit the loop
                exit for
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a serious doubt. Suppose the following scenario: You have a UIViewController onscreen.
I have a scenario where I'm coding a ScrollView which is intended to act
I have a serious long else if statement which contains some links and some
i have very serious problem if any tech expert can help...thank you in advance..
I have begun some serious reading on this framework and i am seeing where
I have a serious probleam with my Eclipse Plugin.. My plugin depends on another
I have a serious problem. One of our servers crashed. Now I reinstalled the
I'm investigating a serious performance problem in my OSGi-based application which is using Eclipselink
Actually I have a serious problem : I saw that somebody has accessed my
I have this serious problem. I have an enumeration within 2 namespaces like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.