Hello, how can I copy an excel sheet to another locked file that is protected with a password of 555
And can I copy in format xlsx
But the important thing is to open the file automatically and copy without asking for a password
And can I copy in format xlsx
But the important thing is to open the file automatically and copy without asking for a password
VBA Code:
Sub CopySheetToClosedWB()
Dim SourceSht As Worksheet
Dim ws As Worksheet
Set SourceSht = Sheets("sheet1")
Application.ScreenUpdating = False
Set closedBook = Workbooks.Open("C:\Users\Admin\Downloads\data.xlsm")
SourceSht.Copy After:=closedBook.Sheets("sheet2")
closedBook.Close SaveChanges:=True
Application.ScreenUpdating = True
End Sub
Last edited: