Application Development and Automation 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: 
Read only

OLE Excel

Former Member
0 Likes
1,012

Sir,

My requirement is to take data in excel and show to user .

There will be 5 columns in toto. 3 columns from sap and 2 has to be input by

the user . The two columns have validations . My requirement is user user

should not be allowed to copy and paste the data he is inputting as the

validation has to fire for every line of entry.

Mandatory user has to type the two rows. No copy paste allowed .

Got the property  "CopyObjectswithcell = flase". But this works in a

macro but does not work through or from SAP.

How to do this ?

Thanks in advance.

Regards

Sir,

My requirement is to take data in excel and show to user .

There will be 5 columns in toto. 3 columns from sap and 2 has to be input by

the user . The two columns have validations . My requirement is user user

should not be allowed to copy and paste the data he is inputting as the

validation has to fire for every line of entry.

Mandatory user has to type the two rows. No copy paste allowed .

Got the property  "CopyObjectswithcell = flase". But this works in a

macro but does not work through or from SAP.

How to do this ?

Thanks in advance.

Regards

6 REPLIES 6
Read only

Kartik2
Contributor
0 Likes
901

Hi,

You can achieve it using OLE technique of abap. Here is one suggestion from me:

1. Record the macro in excel, for what ever formatting and validation you require.

2. Open the VBA macro code generated and analyze

3. Depict the same macro in your ABAP program using OLE techniques.

Please go through the following document, it will help you in converting VBA macro code to abap OLE code:

Hope it helps you. Thank you.

Regards,

Kartik

Read only

Former Member
0 Likes
901

thanks Mr Karthik.

Im doing in OLE only . Im taking data from sap and displaying in in excel using SAP ole code only. Data I have protected the cells which user cant edit . But 2 rows user input is required.

Here I do not want user to do copy and paste of his entries. How to achive this by OLE code.

Regards

Read only

0 Likes
901

Hi,

Please try to record the required macro in excel, and analyze the VBA, if you have any doubt in converting VBA code to abap OLE, then show us the code, we will let you convert it to OLE.

Analyze the VBA macro and try to use the methods and properties available in excel. If at all you are unable to record such a macro then it cannot be achieved using OLE in abap.

Regards,

Kartik

Read only

Former Member
0 Likes
901

Hi,

The recorded OLE is Application.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Application.CutCopyMode = False

End Sub

This event has to get triggerd .

Regards

Read only

0 Likes
901

Hi,

You have to create a range object for those columns, which you dont want to allow cut copy mode. Then on that particular range try to perform the method / property CutCopyMode and equate it to the constant 'False'.

Regards,

Kartik

Read only

Former Member
0 Likes
901

Tried as you said .

But not working. If i record a macro its working but from call method

not working

Regards