Hi all,
I am working on a project where a registration is copied from an internal intranet page and entered into Excel
Now if the user types this in or uses paste special values only then its fine.
But if they use control V or paste or right click paste it wipes out the formatting and even locks the cell.
There are only 4 cells on the sheet that are unlocked. These are either drop down boxes with lists in or just a cell for the registration.
I have spent hours trying to find a solution to prevent the paste being available.
I have some code which disables the paste options when the workbook is opened.
When they click one of the unlocked cells (sheet password ="") it will check if there is anything in the clipboard and ask if they want to paste from the clipboard?
No - it clears the clipboard and does nothing & prevents any paste options.
Yes - it pastes the clipboard as text. (I had to also remove carriage returns as sometimes there are some on the intranet page.
This works fine. But if you then leave the cell selected, go back to the intranet page again and then return, the paste option becomes enabled and allows the user to wipe out the conditional formatting and it also locks the cell which prevents further code from working.
I cant seem to resolve this. Unfortunately Excel doesn't lose focus when you change a window so I cant use the workbook or worksheet deactivate event.
Any solutions to prevent the user from doing this? Yes they should learn to use paste values only but we know that wont ever happen.
The only other option I can see is to use an active X text box control. This will only allow control V to work and that will enter text only.
Look forward to any suggestions.
Bookmarks