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

  • Home
  • SEARCH
  • 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 6659975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:05:50+00:00 2026-05-26T02:05:50+00:00

I am using split function and assigning the value in a variable and running

  • 0

I am using split function and assigning the value in a variable and running the code in loop after few iterations its giving an error of “This array is fixed or temporarily locked (Visual Basic)”..

e.g; here value of movies_cat1 read from excel is in form of this——
“Movies->List All Movies , Movies->World Cinema->Asia , Movies->Movies by Language->Sinhalese , Movies->Drama”

For crow = 1 To 100

    Value = Worksheets("Movies_categories").Range("A" & crow).Value
    cat_final = Worksheets("Movies_categories").Range("B" & crow).Value

    If Value = "y" Or Value = "Y" Then

      'Loop for reading the data from tabsheet- Movies

      For crowss = 5 To 3000
        movies_cat1 = Worksheets("Movies").Range("B" & crowss).Value
        movies_language = Worksheets("Movies").Range("C" & crowss).Value

        If movies_language = "English" Then

          Temp = Split(movies_cat, ",")  'run time Error:10  occurs here..

          For Each boken_c In Temp
            flag = 0
            boken_c = Trim(boken_c)

            If RTrim(LTrim(boken_c)) = LTrim(RTrim(cat_final)) Then
              flag = 1
              GoTo Line4:
            End If
          Next boken_c
        End If
      Next crowss
    End If
Line4:    Next crow

Error occurs at this statement: Temp = Split(movies_cat, ","), it says that the array is fixed or temporarily locked, because i think initially its taking ‘temp’ as a variable, but while returning the value of split function, variable ‘Temp’ becomes array after completion of first loop(i.e after crow = 6,7….)

  • 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-05-26T02:05:51+00:00Added an answer on May 26, 2026 at 2:05 am

    Your line4 label is outside the for loop on the temp variable so when you goto it leaves it locked.

    You really should restructure your code to not use a goto inside the for each loop.

    Maybe:

    For crow = 1 To 100 
    
      Value = Worksheets("Movies_categories").Range("A" & crow).Value 
      cat_final = Worksheets("Movies_categories").Range("B" & crow).Value 
    
      If Value = "y" Or Value = "Y" Then 
    
        'Loop for reading the data from tabsheet- Movies 
    
        For crowss = 5 To 3000 
          movies_cat1 = Worksheets("Movies").Range("B" & crowss).Value 
          movies_language = Worksheets("Movies").Range("C" & crowss).Value 
    
          If movies_language = "English" Then 
    
            Temp = Split(movies_cat, ",")  'run time Error:10  occurs here.. 
    
            For Each boken_c In Temp 
              flag = 0 
              boken_c = Trim(boken_c) 
    
              If RTrim(LTrim(boken_c)) = LTrim(RTrim(cat_final)) Then 
                flag = 1 
                **Exit For**
              End If
              **If flag = 1 Then Exit For**
            Next boken_c 
          End If 
          **If flag = 1 Then Exit For**
        Next crowss 
      End If 
    Next crow 
    

    (Note the **d lines.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using tanzaku in wordpress and get this error Warning: split() [function.split]: REG_EMPTY in /public/wp-content/themes/tanzaku/functions.php
When I write C++ code for a class using templates and split the code
I'm using the os.path.split() function on a path in my program to get the
Hi would it be possible to correctly split function attributes using regex ? i
I am using the split function in JavaScript. It works fine in Firefox and
I'm running into a little trouble with Perl's built-in split function. I'm creating a
I want to split following string into two parts using split function of javascript
I am having problems using the split function in Ruby. /Users/simonprochazka/Downloads/pes_test_p00/lib/main.rb:28: premature end of
A trivial CSV line could be spitted using string split function. But some lines
I'm using the split linux command to split huge xml files into node-sized ones.

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.