title: visual studio attaching to a process in debug mode
body: <p>i have a strange problem.</p>
  
  <p>the dll that i built (lets call it my.dll) in c++ visual studio 2010 uses a third party library (say tp.lib) which in turn calls a third party dll (say tp.dll).</p>
  
  <p>for debugging prupose i have in configurationProperties->debugging->command: Excel.exe
   and configurationProperties->debugging->commandArguments: "$(TargetPath)"</p>
  
  <p>in my computer i also set PATH variable to the directory where tp.dll resides</p>
  
  <p>now when i hit the F5 in visual studio excel opens up with my.dll and crashes giving me a "cannot open in dos mode" error. the reason this happens is tp.dll is not deployed when debug version of my.dll is deployed.</p>
  
  <p>when i open an instance of excel seperately and manually drop the debug version of my.dll then everything works fine and i can see all my functions that i wrote in my.dll</p>
  
  <p>the only issue is now i do not know how to debug becuase i do not know how to attach visual studio to the instance of excel i opened up seperately.</p>
  
  <p>my question is:</p>
  
  <p>1> how can i attach visual studio to an already opened instance of Excel</p>
  
  <p>or</p>
  
  <p>2> how can i hit F5 and still make Excel pick up the required tp.dll from the directory specified in the PATH variable before it starts to deploy my.dll.</p>
  
  <p>any of these two will allow my to step through the code for the purpose of debugging.</p>
  
  <p>thanks in advance.</p>