Hi all, been struggling with this one and could use some help.
Im trying to pull data from a closed workbook. I have a code that has worked for me in the past.
All I have done is edit the path to accommodate for the new workbook, however I keep receiving an error. (1004 unable to set the formulaarray property of the range class)
All I have read in regards to this error has involved exceeding the formulaarray character count, however I am nowhere near that limit.
I have verified the path is inputted correctly.
Im not sure what else could be causing this issue, any thoughts?
Sub Ptrace1()
Dim fpath As String, fname As String, sname As String, cellRange1 As String, cellRange As String, Gblend As Variant
Gblend = ActiveSheet.Range("d11").Value
fpath = "M:\department\intake\update"
fname = "management.xlsx"
sname = "XXX"
cellRange = "$A$7:$Ac$2000"
cellRange1 = "$A$1:$Ac$2000"
if Gblend <> "" then
With ActiveWorkbook.Sheets("DONOTDELETE").Range(cellRange1)
.FormulaArray = "='" & fpath & "\[" & fname & "]" & sname & "'!" & cellRange
.Value = .Value
end with
end if
end sub
Thank you!
Im trying to pull data from a closed workbook. I have a code that has worked for me in the past.
All I have done is edit the path to accommodate for the new workbook, however I keep receiving an error. (1004 unable to set the formulaarray property of the range class)
All I have read in regards to this error has involved exceeding the formulaarray character count, however I am nowhere near that limit.
I have verified the path is inputted correctly.
Im not sure what else could be causing this issue, any thoughts?
Sub Ptrace1()
Dim fpath As String, fname As String, sname As String, cellRange1 As String, cellRange As String, Gblend As Variant
Gblend = ActiveSheet.Range("d11").Value
fpath = "M:\department\intake\update"
fname = "management.xlsx"
sname = "XXX"
cellRange = "$A$7:$Ac$2000"
cellRange1 = "$A$1:$Ac$2000"
if Gblend <> "" then
With ActiveWorkbook.Sheets("DONOTDELETE").Range(cellRange1)
.FormulaArray = "='" & fpath & "\[" & fname & "]" & sname & "'!" & cellRange
.Value = .Value
end with
end if
end sub
Thank you!