Home > Posts > Gotcha: Worksheets property is read-only, Sheets is not – Excel Workbook

Gotcha: Worksheets property is read-only, Sheets is not – Excel Workbook

My contribution to:

http://stackoverflow.com/questions/14109102/how-do-i-add-a-worksheet-after-all-existing-excel-worksheets

 

Seems Worksheets property is read-only

Returns a Sheets collection that represents all the worksheets in the specified workbook. Read-only Sheets object.

https://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx

whereas Sheets is the real thing where you can also add Sheets dynamically

A collection of all the sheets in the specified or active workbook.

https://msdn.microsoft.com/en-us/library/office/ff193217(v=office.15).aspx

  1. No comments yet.
  1. No trackbacks yet.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.