Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
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 4 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 Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!