• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Doesn't pop-up the new workbook while close it

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?

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!
 
at beginning/end of your code, try putting
Code:
Application.ScreenUpdating = False
'do stuff here
Application.ScreenUpdating = True
End Sub
 
Back
Top