title: Copy word textbox value to excel cell
body: <p>I hope someone is able to help me out.  I have a word document that when you click on a command button it will launch the next for you need to fill out.  one of those forms happens to be an excel wb.  i have been able to figure out how to get the file open, but now i can't get the code i would normally use to copy/paste within excel to work.  here is where i am stuck:</p>
  <pre><code>Private Sub StudyTeam_Click()
  Dim xlApp As Excel.Application
  Dim xlwb As Excel.Workbook
  Dim doc As Document
  Set doc = ThisDocument
  
  If StudyTeam.Caption = &quot;Completed&quot; Then
      StudyTeam.Caption = &quot;To Do&quot;
      StudyTeam.BackColor = vbRed
  Else
      PDate = TodaysDate.Value '//transferring textbox value to a public variables
      PTitle = Title.Text'//transferring textbox value to a public variables
      PNum = Num.Text'//transferring textbox value to a public variables
      PPI = PIName.Text'//transferring textbox value to a public variables
      Set xlApp = CreateObject(&quot;Excel.Application&quot;)
      xlApp.Visible = True
      Set xlwb = xlApp.Workbooks.Open(FileName:=&quot;C:\Study\Study File.xlsm&quot;)
      Workbooks(&quot;Study File.xlsm&quot;).Sheets(1).Range(&quot;B7&quot;).Value = PDate '//Word does not recognize this part
      '//where i think i need to start copy/paste rest of variables
  
      StudyTeam.Caption = &quot;Completed&quot;
      StudyTeam.BackColor = vbGreen
  End If
  Set xlApp = Nothing
  Set xlwb = Nothing
  
  End Sub
  </code></pre>
  <p>Any help would be great, thank you.</p>