Hello everyone. I am attampting to insert the following formula into a cell:
sum('[Client_Operations.xlsm]Client_Operations_Details'!$L$2:$L$500)
I am using the code below to do this, and I am receiving an "invalid or unqualified reference" error.
Sub Calculate_157_Disclosures()
Dim sPath1 As String
Const sFileInp1 As String = "157_Disclosure.xlsm"
Const sFileInp2 As String = "Client_Operation.xlsm"
Dim wb1 As Workbook
Dim wb2 As Workbook
sPath1 = fPath & fDate & "_157\157_Reports\IBRD_Disclosure\"
Set wb1 = Workbooks.Open(sPath1 & sFileInp1)
Set wb2 = Workbooks.Open(sPath1 & sFileInp2)
.Range("I14").Formula = "=sum('[Client_Operations.xlsm]Client_Operations_Details'!$L$2:$L$500)"
wb1.Close SaveChanges:=True
wb2.Close SaveChanges:=True
End Sub
Any suggestion on what is going wrong?
Bookmarks