This Code Works for me when I want to close the program I am in.
Sub CloseProgram
Dim I As Integer, j As Integer
j = Forms.Count - 1
For I = j To 0 Step -1
Unload Forms(I)
Next
End Sub
This works for Me!
Private Sub PrintOpenExcelFiles()
Dim oXL As Excel.Application, I1 As Integer
Set oXL = GetObject(, "Excel.Application")
With oXL
I1 = .Workbooks.Count
While I1 > 0
S1 = .Workbooks(I1).Path
If Right(S1, 1) <> "\" Then S1 = S1 +...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.