title: How do I refer to an Excel sheet by name to import Excel data into a Notes app using LotusScript?
body: <p>I am trying to look up some data in an excel sheet to populate a field in a Lotus Notes app on demand. I am using an Action button with LotusScript like so:</p>
  
  <pre><code>Dim v As String
  Dim v2 As String
  'Open XL sheet for access to data
  Set oExcel = CreateObject ( "Excel.Application" )
  v="\\msp2\mi\CSD\Confidential\IT and PPST budget.xlsm"
  Msgbox("opening " &amp; v)
  Set oWorkbook = oExcel.workbooks.open(v)
  Set oWorkSheet= oWorkbook.worksheets (4)
  v2=Cstr(oWorkSheet.Cells(1,1).value)
  Messagebox(v2)
  </code></pre>
  
  <p>This code does work in that it pulls data from cell A1 - but which sheet?<br>
  The sheet containing the data I want is "Sheet4" renamed as "Logic-Detail" but if I use 4 as a parameter as above I get data from the 4th sheet from the left.  I need to be able to cope with sheets being hidden as well. I spent 20 minutes on MSDN's excel object model "help" getting nowhere  :-(
  I feel sure it must be dead easy when you know the answer !</p>