title: How to copy one Excel file to another using spreadsheet light in VB.NET?
body: <p>I have a code wherein I am taking two files. Both are Excel files and I need to copy one file to another. The number of rows and columns in the files are dynamic.  </p>
  
  <p><code>sFile</code> is the source file and <code>sFile1</code> is the destination file. I need to know the number of rows in source file to run a for loop when am copying it to destination file. </p>
  
  <p>The code is below:</p>
  
  <pre><code>Dim shtlight As New SLDocument(sFile1) 
  Dim lrow As Integer 
  Dim lcol As Integer 
  Dim sflie = Environment.Directory &amp; "\Data.xls" 
  lrow = 2  
  Dim shtlight1 As New SLDocument(sFile1) 
  
  For each row in sfile1 
      for column in sfile1 'code here to set value next next
  </code></pre>
  
  <p>I want help in running this for loop, don't know how to set the upper bound as no of rows and columns in file is dynamic. </p>
  
  <p>Can someone help please? I am using phone so format might not be correct. :(</p>