• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

114
Views
Copy worksheet to same workbook and rename it using Javascript

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.

Worksheets("Sheet1").Copy After:=Worksheets("Sheet3")

In Javascript I am trying to do

  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.

about 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error