title: Convert Excel VBA (Macro) to VBScript
body: <p>I have an excel macro like the one below:</p>
  
  
  
  <pre class="lang-vb prettyprint-override"><code>Sub terst1()
      Dim rindex As Long
      Dim saItem() As String
      Dim Arr() As String
      Dim Res() As String
      Dim m As Long, i As Long
      Dim InputRng As Range, OutRng As Range
  
      For rindex = Cells(Rows.Count, "E").End(xlUp).Row To 1 Step -1
          If InStr(Cells(rindex, "E").Value, ";") &gt; 0 Then
              Arr = VBA.Split(Cells(rindex, "E").Value, ";#")
              m = UBound(Arr) \ 2
              ReDim Preserve Res(m)
  
              For i = 0 To m
                  Res(i) = Arr(i * 2)
              Next
  
              Rows(rindex + 1 &amp; ":" &amp; rindex + UBound(Res)).Insert
              Cells(rindex, "E").Resize(UBound(Res) + 1).Value = WorksheetFunction.Transpose(Res)
          End If
      Next rindex
  End Sub
  </code></pre>
  
  <p>I want to convert the above macro into VBScript where the file path should be part of code.</p>
  
  <p>I have below VBScript but it is giving me only first name and rest are skipped.</p>
  
  <pre class="lang-vb prettyprint-override"><code>Dim c
  Dim d
  
  Set objExcel = CreateObject("Excel.Application")
  Set objWorkbook = objExcel.Workbooks.Open("D:\test4.xlsm")
  
  objExcel.Visible = True
  objExcel.displayalerts = false
  
  Set objExcel2 = CreateObject("Excel.Application")
  
  strPathExcel = "C:\Users\Desktop\test4.xlsx"
  objExcel2.Workbooks.open strPathExcel 
  
  Set oSheet = objExcel2.ActiveWorkbook.Worksheets(1)
  
  a = 2
  i = 2
  j = 2
  
  Do Until objExcel.Cells(a, 1).Value = ""
      c = 0
      d = 0
  
      Do Until c = objExcel.Cells(j, 3).Value
          inputText=objExcel.Cells(j, 5).Value
          oSheet.Cells(i,3).Value = split(inputText,";#")
  
          c = c + 1
          d = d + 1
      Loop
  
      i = i + 1   
      a = a + 1
      j = j + 1
  Loop
  
  objExcel.Save
  objExcel2.Save
  
  objExcel.Quit
  objExcel2.Quit
  </code></pre>