Code:Sub ReplaceWBK() Dim strPath As String With ThisWorkbook strPath = .FullName .ChangeFileAccess xlReadOnly Kill ThisWorkbook.FullName FileCopy "Source Path\FileName", ThisWorkbook.FullName .Close 0 End With Workbooks.Open (strPath) End Sub
Code:Sub ReplaceWBK() Dim strPath As String With ThisWorkbook strPath = .FullName .ChangeFileAccess xlReadOnly Kill ThisWorkbook.FullName FileCopy "Source Path\FileName", ThisWorkbook.FullName .Close 0 End With Workbooks.Open (strPath) End Sub
A dream is not something you see when you are asleep, but something you strive for when you are awake.
It's usually a bad idea to say that something can't be done.
The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve
Join us at Facebook
Bookmarks