2012 Aug 29 9:35 AM
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
2012 Aug 29 9:47 AM
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
2012 Aug 29 10:02 AM
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
2012 Aug 29 10:12 AM
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
2012 Aug 29 10:20 AM
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
2012 Aug 29 10:55 AM
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
2012 Aug 29 11:50 AM
Tried as you said .
But not working. If i record a macro its working but from call method
not working
Regards
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |