title: Creating Named Ranges in Excel using Vb Script
body: <p>I created a code for creating Named Ranges in Excel using Range object but didn't work as it works in VBA. Error comes in the statement where I try to create a Range object, not sure how this could be done.</p>
  
  <p>If anyone could suggest me an idea it would great.</p>
  
  <pre><code>Set Exobj = CreateObject("Excel.Application")
  Set Newbook = Exobj.Workbooks.Add()
  Newbook.SaveAs("C:\Users\ACER\Desktop\Project Folder\Test17.xlsx")
  
  Exobj.Workbooks.Open("C:\Users\ACER\Desktop\Project Folder\Test17.xlsx")
  Exobj.Visible = True
  
  Set Myrange = Exobj.Worksheets(sheets1).Range("A1:H11") ' statement where Error comes
  
  For each C in Myrange
  If c.Value = "" Then 
  C.Value ="Blank"
  End if
  Next
  
  Exobj.Workbooks.Save()
  Exobj.Activeworkbooks.Close()
  </code></pre>