title: How can i add a sheet in another workbook that not active
body: <p>can someone help me, i try to write a code with 2 file open ABC.xlsm and KM.xlsm
  .Thisworkbook is ABC.xlsm</p>
  <pre><code>sub copy()
  Dim sh As Workbook
  Dim tensheet As String
  Set sh = Workbooks(&quot;KM.xlsm&quot;)
  tensheet = Range(&quot;O2&quot;).Value
  sh.Sheets.Add(After:=Sheets(Sheets.Count)).Name = tensheet
  end sub
  </code></pre>
  <p>i get this error &quot;runtime error 1004 application-defined or object-defined error&quot;
  this code will run if i add &quot;sh.active&quot; before add a new sheet but i dont want to. Any help?</p>