• 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.

VBA Open

S P P

Member
Something is not working in this VBA.

What Could Be Wrong

>>> use code - tags <<<
Code:
Dim Wbx As String
Wbx = "SSP.xlsm"

     For Each Wb In Workbooks
     If Not (Wb Is Wbx) Then
     Wb.Close SaveChanges:=True
End If
Next
 
Last edited by a moderator:
Check your spelling ?

Code:
Option Explicit

Sub sving()

    Dim wb As Workbook
    Dim Wbx As String
    Wbx = "SSP.xlsm"

    For Each wb In Workbooks
        If wb.Name <> Wbx Then
            wb.Close SaveChanges:=True
        End If
    Next wb

End Sub
 

Attachments

  • SSP.xlsb
    17.3 KB · Views: 0
You asked something about open, but ...
Your code misses any open commands.
Your code should have something about open to open something?
... or Your thread's title is something else than You're asking.
 
Back
Top