Reputation: 387
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 str defined as Variant i.e
Dim str As Variant
But when I try to access specific entry in it. i.e
Dim str1 As Variant
str1 = str.str(1).str(1 , 2)
It gives the following error
How can I get specific entries from
str
so that I can split it to display in excel cells . I am new to macro programming.
Upvotes: 3
Views: 898
Reputation: 2693
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)
Better, try:
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
Upvotes: 2