pulling information from a closed workbook (revised)

G

Guest

i am sorry, the code in the original post is not correct, it should be this:

Function GetValuesFromAClosedWorkbook(fPath As String, _
fName As String, sName, cellRange As String)

With ActiveSheet.Range(cellRange)
.FormulaArray = "='" & fPath & "\[" & fName & "]" _
& sName & "'!" & cellRange
.Value = .Value
End With
End Function


Sub test1()
GetValuesFromAClosedWorkbook "E:", "Book1.xls", "Sheet1", "A4:J4"
End Sub

sorry for the confusion.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top