[4347] in sapr3-soft
Problem in OfficeIntegration with macro VB in Excel
daemon@ATHENA.MIT.EDU (Gedis AS)
Tue Nov 2 13:35:13 1999
To: sapr3-soft@MIT.EDU
Date: 2 Nov 1999 12:30:57 -0600
From: "Gedis AS" <gedis@pophost.eunet.be>(by way of SAP Moderator <sap-request@realtimeusa.com>)
Message-Id: <7vnal1$mib@nexus.netconcepts.com>
I've wrote a program that communicate whith Excel.
I want to send the data's from an internal table in SAP to an Excel Sheet.
In the BC415 document, I have an example of "reading an Internal Table Using
a macro".
I have used this example to make my program without success.
In the program Abap I have the following coding :
CALL METHOD OFFICE->GET_TABLE_COLLECTION
IMPORTING
TABLE_COLLECTION = TABLE_COLLECTION
RETCODE = RETCODE.
CALL METHOD TABLE_COLLECTION->ADD_TABLE
EXPORTING
TABLE_NAME = 'ITAB'
TABLE_TYPE = 1
IMPORTING
RETCODE = RETCODE
CHANGING
DATA_TABLE = ITAB[].
CALL METHOD DOCUMENT->EXECUTE_MACRO
EXPORTING
* macro_string = 'FILLTABLEFROMR3'
MACRO_STRING = 'MACRO1'
IMPORTING
RETCODE = RETCODE.
ENDFORM. " GANITURE_DOCUMENT
In Excel I have the following macro.
Sub FILLTABLEFROMR3()
Dim R3TABLE As Object
Dim ExcelRange As Excel.Range
Set R3TABLE = ThisWorkbook.Container.Tables("ITAB").Table
Set ExcelRange = Sheet1.Range(Sheet1.Cells(1, 1),
Sheet1.Cells(R3TABLE.Rows.Count, R3TABLE.Rows.Count))
ExcelRange.Value = R3TABLE.Data
End Sub
When I execute my program, in excel I have the error code 424, and I don't
understand why ?
Someone can help me to resolve this problem ? My E-Mail is
jc_onderbeke@swing.be
Thank you in advance.
Jean-Claude Onderbeke from Belgium.