title: How can I disable the clipboard prompt in excel vba when I close the workbook?
body: <p>So I'm working with multiple workbooks from which I copy all the data from Sheet1 from each one into their respective sheet on the master workbook. After I do that, I have the multiple workbooks encoded to close. However, an annoying prompt asking if I want to keep the copied data on clipboard consistently pops up and I want to either have it not pop up or when it does, I want "No" to be automatically chosen.</p>
  
  <p>I know there's a similar question that's been asked but it hasn't worked for me and I'm thinking it's because I have a rectangular area of data instead of just a column? I really new at vba but I tried messing around with the code in <a href="https://stackoverflow.com/questions/5163265/disable-clipboard-prompt-in-excel-vba-on-workbook-close">Disable clipboard prompt in Excel VBA on workbook close</a> but I've had no luck. </p>
  
  <p>Here's my original code:</p>
  
  <pre><code>Sub CFM56copydata()
  Dim wbk As Workbook
  'The workbook is opened using the text from a textbox in a userform i.e:
  strFirstFile = Userform1.dog.Text
  Set wbk = Workbooks.Open(strFirstFile)
  With wbk.Sheets("Sheet1")
  Range("A1").Select
  Range(Selection, Selection.End(xlDown)).Select
  Range(Selection, Selection.End(xlToRight)).Select
  Selection.Copy
  End With
  Set wbk2 = ThisWorkbook
  wbk2.Sheets("dog").Range("A1").Insert
  wbk.Close
  End Sub
  </code></pre>
  
  <p>and here's how I tried to tweak it so I avoided using the clipbaord at all. (Didn't work, gives me a debug error on line 12)</p>
  
  <pre><code>Sub fix()
  Dim wbk As Workbook
  strFirstFile = Userform1.CFM56path.Text
  Set wbk = Workbooks.Open(strFirstFile)
  Set wbk2 = ThisWorkbook
  Dim rSrc As Range
  Dim rDst As Range
  Range("A1").Select
  Range(Selection, Selection.End(xlDown)).Select
  Range(Selection, Selection.End(xlToRight)).Select
  Set rSrc = Selection
  Set rDst = wbk2.Sheets("dog").Cells("A1").Resize(rSrc.Rows.Count, rSrc.Columns.Count)
  rDst = rSrc
  wbk.Close
  End Sub
  </code></pre>