Hi Gutalin,
wks in your code means a worksheet, right? There is no AddLayer method for Worksheet class. This method is for Page class. You can refer to examples in this page for more information about how to use this method.
For your issue, you can use like:
Worksheet wks = Project.ActiveLayer(); // get active worksheet
if(!wks)
return;
WorksheetPage wp = wks.GetPage(); // get the workbook of the worksheet
wp.AddLayer("name"); // add worksheet to the workbook
Penn