Can any help me to read a specific range of a specific sheet of an excel file saved in a specific file path => using the VB scripting component - without installing an external gh add-on.
Can anyone share a simple example for me to follow?
I have component right now in VB, that reads from the excel that is active alongside the gh script, doesnt do a specific path.
Scrpit:
Private Sub RunScript(ByVal SheetName As Object, ByVal RangeName As String, ByVal Stream As Boolean, ByRef Data As Object, ByRef A As Object)
If Stream = True Then
Dim objExcel, excelSheet, wb, ws As Object
objExcel = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")
For Each wb In objExcel.Workbooks
For Each ws In wb.Worksheets
If ws.CodeName = SheetName Then
excelSheet = ws
Data = excelSheet.Range(RangeName).value
End If
Next
Next
End If
Can anyone suggest an udpdate to this to make read from a path? and not just an active file?
Thanks a ton in advance.
uploading the component i am using right now,
excel read component.gh (3.9 KB)