pull data from cclosed wb: formulaaray error

njeck

New Member
Joined
Aug 8, 2017
Messages
1
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!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top