title: Issue copying cell value to clipboard (DataObject) on DoubleClick in VBA
body: <p>Very new to VBA. I am having issues trying to automatically copy the text from a cell which has been double-clicked. I have tried every which way, but something is obviously wrong. Any help would be greatly appreciated.</p>
  
  <p>My code in ThisWorkbook:</p>
  
  <pre><code>Option Explicit
  
  Dim MyData As DataObject
  
  Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
      Cancel = False
      Set MyData = New DataObject
      MyData.SetText Target.Text
      MyData.PutInClipboard
      Cancel = True
  End Sub
  </code></pre>