title: I can't figure out the .FieldName
body: <p>I am trying to create my first VBScript that creates an Excel spreadsheet. </p>
  
  <p>I got most of the code from an Excel Macro but the project changed so now the VBScript needs to live on the outside.</p>
  
  <p>I was crashing on rStart = .Range but I changed the code to </p>
  
  <pre><code> Set rStart = objExcel.Range("A1")
  </code></pre>
  
  <p>Now I am crashing on 
  Also if someone can explain why some of the code starts with .ColumnWidth, .Range, .Cells</p>
  
  <p>I looked up some of these things and it can come from a number of places. Not sure how to determine which one.</p>
  
  <p>For example</p>
  
  <p>.Range can come from Excel.Application or Excel.Application.AutoFilter or Global.Range, etc.</p>
  
  <pre><code>Set objExcel = CreateObject("Excel.Application")
  objExcel.Visible = True
  Set objWorkbook = objExcel.Workbooks.Add()
  objWorkbook.SaveAs(strFileName)
  
  Dim lMonth 'As Variant
  Dim strMonth 'As String
  Dim rStart 'As Range
  Dim strAddress 'As String
  Dim rCell 'As Range
  Dim lDays 'As Long
  Dim dDate 'As Date
  
  'Add new sheet and format
  'Worksheets.Add
  objExcel.Worksheets.Add
  'ActiveWindow.DisplayGridlines = False
  objExcel.ActiveWindow.DisplayGridlines = False
  With objExcel.Cells
      .ColumnWidth = 6
      .Font.Size = 8
  End With
  
  'Create the Month headings
  For lMonth = 1 To 4
      Select Case lMonth
          Case 1
          strMonth = "January"
          Set rStart = .Range("A1") 
          Case 2
          strMonth = "April"
          Set rStart = .Range("A8")
          Case 3
          strMonth = "July"
          Set rStart = .Range("A15")
          Case 4
          strMonth = "October"
          Set rStart = .Range("A22")
      End Select  
  
      'Merge, AutoFill and align months       
      With rStart         
          rStart.Value = strMonth
          .HorizontalAlignment = xlCenter // Crashing here
          .Interior.ColorIndex = 6        
          .Font.Bold = True           
          With .Range("A1:G1")                
              .Merge              
              .BorderAround xlContinuous              
          End With            
          .Range("A1:G1").AutoFill Destination=.Range("A1:U1")            
      End With        
  Next
  </code></pre>
  
  <p>I've tried using </p>
  
  <pre><code> rStart.HorizonalAlignment = xlCenter
   objExcel.Range.HorizontalAlignment = xlCenter
  </code></pre>
  
  <p>I am trying to create an External VBScript that will create an Excel file (no Module Macro or VBA Projects within an Excel document).</p>
  
  <p>The error message says "Unable to set the HorizontalAlignment property of the Range class"</p>