I have this macro which fetches using Rfc connection. I am able to fetch the data but I require to split the data as per requirement. The screen shot below , The first Line shows The table from which I am fetching the data.
I have declared RFC_TAB as Object and I am fetching data into it.
Dim RFC_TAB As Object
The Below screenshot shows the data.
I am moving the data into
defined as Variant
Dim str As Variant
But when I try to access specific entry in it.
Dim str1 As Variant str1 = str.str(1).str(1 , 2)
It gives the following error
How can I get specific entries from
so that I can split it to display in excel cells .
I am new to macro programming.
str appears to be a 2d array of type
Variant(). You have to address the correct index, try:
Dim str1 As Variant str1 = str(1 , 2)
Dim str1 As String str1 = str(1 , 2)
For extreme safety, try:
Dim str1 As String str1 = CStr(str(1 , 2))
Given you know the
type of the object you are addressing