roberttanenbaum,
If you notice, my code doesn't add the worksheet into the same workbook, instead it adds into the workbook wb which is sent as a parameter.
I even tried with ws.CopyTo(wb,"NewName"), but still getting the same exception.
If you notice, my code doesn't add the worksheet into the same workbook, instead it adds into the workbook wb which is sent as a parameter.
I even tried with ws.CopyTo(wb,"NewName"), but still getting the same exception.