title: How to profile/debug VBA script that works fine on XLS files, but hangs on XLSX files?
body: <p>I have a VB script that does row processing on a small Excel file (35 columns, 2000 rows, no hidden content). It takes about 3 seconds to process the file when applied to an .xls file. If I save the .xls as a .xlsx file, the same script takes about 30 to 60 seconds, completely freezing Excel several times in the process (although it finishes and the results are correct).</p>
  
  <p>I suspect some loop parts of the code are responsible, but I need to find out which. I have found scripts like <a href="https://stackoverflow.com/a/3506143/5064264">https://stackoverflow.com/a/3506143/5064264</a> which basically amount to timing all parts of the script by hand - similar to <code>printf</code>-debugging, which is not very elegant and also consumes much time for large scripts.</p>
  
  <p><strong>Is there a better alternative to semi-manual profiling, like performance analyzers in most IDEs, or exist any other approaches to this problem?</strong> I do not want to post the code as it is rather long and I also want to solve it for other scripts in the future.</p>