title: Excel macro: How to extract data from other Excel file
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12380901/excel-macro-browse-excel-file-and-use-its-worksheet-data">excel macro: browse excel file and use its worksheet data</a>  </p>
  </blockquote>
  
  
  
  <p>In brief, I want to write a script can do this.
  In the current excel file, there is a macro button. The user can click the button to browse files (another Excel). In that browsed Excel, several worksheets will be load to current Excel workbook and the data will be used.
  I write like this</p>
  
  <pre><code>Sub Button1_Click()     ' choose LOAD path
  
      objFile = Application.GetOpenFilename(fileFilter:="All Files (* . *) , * . * ")   ' browse function
  
      ...    ' following
  
      Call main_function
  End Sub
  </code></pre>
  
  <p>I write the browse function already. but how to write the following part? eg. the certain worksheet's data in objFile will be used in main_function.</p>