ClulessChris
IS-IT--Management
Some time back I found and used the following function. Recently I've found that this will not copy all info from a given cell. i.e. is a cell holds large amounts of text only some of this will be collected by the function.
Can you suggest a fix or an alternative?
Never knock on Death's door: ring the bell and run away! Death really hates that!
Can you suggest a fix or an alternative?
Code:
Private Function GetInfoFromClosedFile(ByVal wbPath As String, wbName As String, wsName As String, cellRef As String) As Variant
Dim arg As String
GetInfoFromClosedFile = ""
If Right(wbPath, 1) <> "\" Then wbPath = wbPath & "\"
If Dir(wbPath & "\" & wbName) = "" Then Exit Function
arg = "'" & wbPath & "[" & wbName & "]" & wsName & "'!" & Range(cellRef).Address(True, True, x1R1C1)
On Error Resume Next
GetInfoFromClosedFile = ExecuteExcel4Macro(arg)
End Function
Never knock on Death's door: ring the bell and run away! Death really hates that!