Hello,
Hope someone can help with my first question, I've searched the threads and cannot find an answere
Problem A :
I am trying to close all inactive workbooks and using the following code :
Public Sub CloseAllInactive()
Dim Wb As Workbook
Dim AWb As String
AWb = ActiveWorkbook.Name
SaveAll
For Each Wb In Workbooks
If Wb.Name <> AWb Then
Wb.Close savechanges:=True
End If
Next Wb
Application.StatusBar = "All Workbooks Closed."
End Sub
The issue is that I am first copying data from file x and pasting file y (file y is constant and will always be called "Consolidated Logs"
and then trying to close file x with the above code, but I get a message asking if I want to save to the clipboard? If I chose Y, the system hangs and if I chose N, the details don't paste! Any ideas?? I just want to close file x after pasting to file y and leave file y open.
Second part of my question is : how to I insert the file name of an open workbook into the worksheet, cell A:1
Many thanks in advance
Mark
Hope someone can help with my first question, I've searched the threads and cannot find an answere
Problem A :
I am trying to close all inactive workbooks and using the following code :
Public Sub CloseAllInactive()
Dim Wb As Workbook
Dim AWb As String
AWb = ActiveWorkbook.Name
SaveAll
For Each Wb In Workbooks
If Wb.Name <> AWb Then
Wb.Close savechanges:=True
End If
Next Wb
Application.StatusBar = "All Workbooks Closed."
End Sub
The issue is that I am first copying data from file x and pasting file y (file y is constant and will always be called "Consolidated Logs"
Second part of my question is : how to I insert the file name of an open workbook into the worksheet, cell A:1
Many thanks in advance
Mark