Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on OLE excel paste in selected cell range

vt_vt
Explorer
0 Kudos

Hi Friends,

I need to paste the clipbord contents in a selected range of cells using ole automation.

Rage is selected using the following code :

CALL METHOD OF G_EXCEL 'Cells' = G_CELL1

EXPORTING #1 = 4

#2 = 1.

CALL METHOD OF G_EXCEL 'Cells' = G_CELL2

EXPORTING #1 = P_ROW

#2 = gv_col.

CALL METHOD OF G_EXCEL 'Range' = G_CELLRANGE

EXPORTING #1 = G_CELL1

#2 = G_CELL2.

now need to past the clipbord contents in G_CELLRANGE.

Would appriciate your help,

Thanks,

John

6 REPLIES 6

former_member156446
Active Contributor
0 Kudos

Check this simple and very understanding Blog by Rich: [Manipulate Excel with OLE & ABAP|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417100%29ID1618511350DB10403094249511349855End?blog=/pub/wlg/2341%3Fpage%3Dlast%26x-maxdepth%3D0]

0 Kudos

Hi Friend,

I have gone through that blog before posting my query, it does not have the coding for Paste in selected range.

Thanks foe your help, i have checked th forum before posting this, as could not found any related one.

John

0 Kudos

Hi John,

Use method PASTE as below:

CALL METHOD OF G_CELLRANGE 'PASTE'.

Regards,

Nisha Vengal.

naimesh_patel
Active Contributor
0 Kudos

Try like this, once your range has been selected.


CALL METHOD OF G_EXCEL 'Paste' .

Regards,

Naimesh Patel

Clemenss
Active Contributor
0 Kudos

Hi Jhon,

this is the obsolete old way even Rich would not recommend (look at the age of the blog).

There are far better and much more performat ways doing this using Desktop Office Integration.

Refer to this complete documentation of [Desktop Office Integration (BC-CI)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf]

It took me some time to create my first application with DOI, but if you have done you will never want to miss it.

Regards,

Clemens

Former Member
0 Kudos

Hi,

After selecting the Cell, Use the PASTE

ActiveSheet.Paste