The problem with this code is that the newly saved file opens two Excel files. One has the name "test.xlsx" (and is empty) and the other is called "Excel" and this file is the copied sheet from the main Excel file ("Data.xlsx").
Does anyone know why the saved file opens two Excel files and how I can fix this?
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim myExcel, objWorkbook, objWorkSheet, objSheet
Set myExcel = CreateObject("Excel.Application")
myExcel.Visible = false
Set objWorkbook = myExcel.Workbooks
Set objWorkSheet = objWorkBook.Open("C:\Users\111660\Desktop\Data.xlsx")
Set objWorkSheet = objWorkbook.Open("C:\Users\111660\Desktop\test.xlsx")