PDA

View Full Version : Office clipboard as datasource



amateur
12-20-2010, 02:17 AM
Is there any way using the Office Clipboard instead of XP Clipboard as datasource?

I have a workbook with a macro in it that works as follows:

1, I put some data to clipboard either in an e-mail or in another excel workbook
2, the macro activates a certain sheet
3, unmerges all previously merged cells (Cells.UnMerge)
4, pastes content of the clipboard

In the case of the content of clipboard is stem from e-mail sw the macro works good. In the other case (copying data in another excel workbook) I get a runtime error "runtime error 1004 paste method of worksheet class failed"



Runing the code line by line I found that XP clipboard has been emptied as soon as Cells.UnMerge line terminates and the line Activesheet.Paste found Clipboard empty

So I want to know if I can use Office clipboard instead of XP clipboard as datasource of paste.