View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Fix code - check to see if a workbook is open, if so, save cha

Sub jw()
Dim wb As Workbook, s As String
s = "Aldridge.xls"
is_it_open = False
For Each wb In Workbooks
If wb.Name = s Then is_it_open = True
Next
MsgBox (is_it_open)
If is_it_open Then
Windows("Aldridge.xls").Activate
ActiveWorkbook.Save
ActiveWorkbook.Close
End If
End Sub

--
Gary''s Student - gsnu200749


"J.W. Aldridge" wrote:


Thanx GS, but need a little more action than just checking....

Need wb to save and then close if it is found to be open.

Thanx