Excel Interop – Add a new worksheet after all of the others

Looking at the documentation here http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.worksheet.move(v=vs.80).aspx, it indicates that the ‘after’ object isn’t a numerical position; it’s the object representing the sheet you want to position your sheet after. The code should probably be something like (untested):

workbook.Sheets.Add(After: workbook.Sheets[workbook.Sheets.Count]); 

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)