Background
I have an Excel 2007 form where the user enters some data into a textbox and if they click the OK command button, a macro runs based on that text. However, in the case that they copy a string from somewhere else (eg Ctrl + C
) and then paste for the first time and press OK, the copy buffer seems to be cleared; if they try pasting again anywhere a second time, nothing happens. However, if they click the Cancel command button, they retain their second+ paste ability. The macro that is run upon the OK click is pretty simple: it creates a new sheet, inserts some data from a database, and performs some loop checks on it, so I don't think any of the VBA methods would clear the copy buffer. The only thing I can think of is the .Select
it uses at one point to then setup a .PrintArea
, but that shouldn't have any copy/paste effect as it doesn't copy/paste selected data as all of that is done through Cells(row, col) = Cells(row, col)
syntax. Furthermore, when I have the clipboard pane up, it doesn't wipe anything; the entries remain there.
Question
Is it simply a bug that Excel 2007 eats the copy buffer after executing a macro linked to a command button/textbox or is there something that is likely causing the issue? In the case that it's a bug, is there a method to put back into Ctrl + C
the string that the user originally entered?