Hello Leith & madadd
GET DATA WITHOUT OPENING WORKBOOK
I'm looking at your code and I've noticed that you are actually opening and then closing the workbook you want the information from. Are you aware that that information can be obtained without opening the workbook ? The use of command "ExecuteExcel4Macro" along with the path, filename , sheet and cell will return the value from the closed book.
Here's a little demo of what i'm talking about ...
Public Sub DEMO()
MsgBox GetInfoFromClosedBook("C:\", "NotOpen.xls", "Sheet1", 1, 1)
End Sub
Public Function GetInfoFromClosedBook(Path, FileName, SheetName, RowNum, ColNum)
GetInfoFromClosedBook = ExecuteExcel4Macro("'" & Path & "[" & FileName & "]" & SheetName & "'!R" & RowNum & "C" & ColNum)
End Function
Bookmarks