title: Creating Powershell script to loop through excel file and create folders
body: <p>I'm new to Powerscript and looking at writing a solution to loop through an excel file and create a folder for each row in the file.</p>
  
  <p>At the moment I have the following:</p>
  
  <pre><code>$objExcel = new-object -comobject excel.application 
  
  $objExcel.Visible = $True 
  
  $ExcelFilesLocation = “D:\Users\”
  
  $UserWorkBook = $objExcel.Workbooks.Open($ExcelFilesLocation + “ProjectCodes.xlsx”) 
  
  $UserWorksheet = $UserWorkBook.Worksheets.Item(1)
  
  $intRow = 2
  
  Do {
  
   $Projectcode = $UserWorksheet.Cells.Item($intRow, 1).Value()
  
   $pos = $userLogOnEmail.IndexOf(“@”)
  
             $intRow++
  
             } While ($UserWorksheet.Cells.Item($intRow,1).Value() -ne $null)
  
  $objExcel.Quit()
  
  $a = Release-Ref($UserWorksheet)
  
  $a = Release-Ref($UserWorkBook) 
  
  $a = Release-Ref($objExcel)
  </code></pre>
  
  <p>The idea is to loop through the project code column for each row. Then create a folder that is named for the project code.</p>