Hi guys,
Can you please help me out with some sample code, how to access a closed excel file from a particular folder using vba code.
My consern is everytime i need to open a differet closed excel.
Hi guys,
Can you please help me out with some sample code, how to access a closed excel file from a particular folder using vba code.
My consern is everytime i need to open a differet closed excel.
please some one help me..
it's urgent
You should allow time for an answer. If you bump your post, it may not be seen as a 0 response will get more attention. You can bump if more than 1 day has passed.
To get one value:
[vba]Sub t()
MsgBox GetInfoFromClosedFile(ThisWorkbook.path, ThisWorkbook.Name, "Sheetx", "A1")
MsgBox Workbooks(ThisWorkbook.path & "\PageSetup2.xls").Name
End Sub
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, xlR1C1)
On Error Resume Next
GetInfoFromClosedFile = ExecuteExcel4Macro(arg)
End Function[/vba]
Ok Thanks a lot..