title: Can I use VBScript to take existing CSVs and make them tabs of a single Excel Workbook?
body: <p>I'm attempting to automate a process in which I take multiple CSVs from a directory and make them each their own tab in an Excel workbook so I can pivot off their data and such. I'm trying to avoid using macros if possible... Is it possible to do this in VBScript?
  Here is what I have tried so far, please excuse my programming conventions as I've only just recently learned the basics of VBS:</p>
  
  <pre><code>Call createWkbk()
  
  Function createWkbk()
  strFileName = "c:\test1.xls"
  
  Set objExcel = CreateObject("Excel.Application")
  objExcel.Visible = True
  
  Set objWorkbook = objExcel.Workbooks.Add()
  
  'Adds one spreadsheet to book for each command
  objExcel.ActiveWorkbook.Worksheets.Add
  objExcel.ActiveWorkbook.Worksheets.Add
  objExcel.ActiveWorkbook.Worksheets.Add
  
  'This renames all the sheets to 'int#'
  objExcel.Sheets(1).Name = "int1"
  objExcel.Sheets(2).Name = "int2"
  objExcel.Sheets(3).Name = "int3"
  objExcel.Sheets(4).Name = "int4"
  objExcel.Sheets(5).Name = "int5"
  objExcel.Sheets(6).Name = "int6"
  
  'To save the book
  objWorkbook.SaveAs(strFileName)
  
  objExcel.Quit
  End Function
  </code></pre>
  
  <p>So now the only thing I need to do is write those CSVs I already have into those sheets, or import them from the very beginning. If not in VBScript, what is the suggested route to take?</p>
  
  <p>Thank you all in advance,</p>
  
  <p>Nic</p>