Villalobos
Active Member
Hello,
I would have a question regarding workbook closing. The below mentioned code working fine just when I run this "copy/save worksheets and after close workbook" method the new workbook pop-up for a moment while closing.
I would like to ask that how is it possible that the Excel doesn't pop-up it even for a moment while close the new workbook?
Thank you for your advice!
I would have a question regarding workbook closing. The below mentioned code working fine just when I run this "copy/save worksheets and after close workbook" method the new workbook pop-up for a moment while closing.
I would like to ask that how is it possible that the Excel doesn't pop-up it even for a moment while close the new workbook?
Code:
Dim wbS As Workbook, wbT As Workbook
Dim wsS As Worksheet, wsT As Worksheet
Set wbS = ThisWorkbook
Set wsS = wbS.Worksheets("Test")
wsS.Copy
Set wbT = ActiveWorkbook
Set wsT = wbT.Worksheets("Test")
wsT.Name = "Test"
wbT.SaveAs wbS.Path & "\Test" & Sheet1.Range("B8") & ".xlsx"
Workbooks("Test" & Sheet1.Range("B8") & ".xlsx").Close SaveChanges:=False
Thank you for your advice!