I am trying to write a function where a specified workbook is opened and then we need to copy existing sheet and make a copy of it in the same workbook and rename that worksheet. I saw this feature is implemented In VBA using the code below.
var xlApp = new ActiveXObject("Excel.Application"); var xlWorkbooks = xlApp.Workbooks; var xlWorkbook = xlWorkbooks.Open(xlFileName); var xlWorksheets = xlWorkbook.Worksheets; var xlWorkSheet = xlObj.getWorksheet("PRC1.1"); xlWorkSheet.copy();
This code is creating a copy in new workbook but I want in the same workbook.
Any Answers would be highly appreciated. Thanks in Advance.