I understand I can automate Excel using ExcelApplication object.
But how can I access windows functions such as GetObject ( GetObject function (Visual Basic for Applications) | Microsoft Learn) to access a Worksheet object like below (within Excel VBA):
GetObject("C:\Myfile.xlsx").Worksheets("MySheet")
I thought I might need to create an OLEObject and use invoke method on it, but not sure what parameter I would use to construct the OLEObject to access GetObject?
Background: I’d like to use GetObject to avoid opening Excel files to read from it in the traditional way so it remains invisible to the end user