I got this error in this highlighted line and I want to read these ranges and get data into my array.
How can I fix this and get my data into my array?
Thank you
Code:
Private Sub VSFlexGrid2_DblClick()
Dim oXLBook As Excel.Workbook
Dim oXLSheet As Excel.Worksheet
Dim Style_no As String
Dim Line_no As String
Dim vArray As Variant
Dim Array1(D12 To H138, Q138 To [highlight #FCE94F]V12[/highlight]) As Variant
Style = Trim(VSFlexGrid2.TextMatrix(VSFlexGrid2.Row, 1))
If VSFlexGrid2.Row <= 0 Then
Exit Sub
Else
Set oXLApp = New Excel.Application
Set oXLBook = oXLApp.Workbooks.Open("K:\GENERAL\POD_Infor\" & Style & ".xls")
Set oXLSheet = oXLBook.Worksheets(1)
Set oXLSheet2 = oXLBook.Worksheets(2)
With oXLSheet
For i = D12 To H138
For i2 = Q138 To V12
Array1(i, i2) = X
X = X + 1
Next
Next
End With
End If
End Sub
How can I fix this and get my data into my array?
Thank you