I've saved this from one of JB's posts and it works well to update some values within a closed workbook, but only if the workbook is not password protected.
Is there anything that can be done in this situation and also to not have to select enable macros for every workbook?
Sub Update_WB_Values()
Dim fPATH As String, fNAME As String, wb As Workbook
fPATH = ThisWorkbook.Path & Application.PathSeparator
Application.ScreenUpdating = False
fNAME = Dir(fPATH & "*.xl*")
Do While Len(fNAME) > 0
If fNAME <> ThisWorkbook.Name Then
Set wb = Workbooks.Open(fPATH & fNAME)
With wb
With .Sheets("Application")
.Range("I11").Value = 12.43
.Range("J11").Value = 16.9794
.Range("I13").Value = 3.82
.Range("J13").Value = 6.3938
End With
.Close True
End With
End If
fNAME = Dir
Loop
Application.ScreenUpdating = True
End Sub
Bookmarks