RE: $$Excel-Macros$$ IF statement to test if Excel Clipboard is Empty

2010-01-27 Thread Dave Bonallack
Hi, I found this on the net. Seems to work. Regards - Dave. > Date: Wed, 27 Jan 2010 08:15:05 -0800 > Subject: Re: $$Excel-Macros$$ IF statement to test if Excel Clipboard is Empty > From: jon.wester...@gmail.com > To: excel-macros@googlegroups.com > > Thanks. I tried this

Re: $$Excel-Macros$$ IF statement to test if Excel Clipboard is Empty

2010-01-27 Thread excelCPA
Thanks. I tried this one, unfortunately it errors out at line: stext = MyData.GetText when the clipboard is empty. I get the error: Run0time error '-2147221404 (80040064)': DataObject:GetText Invalid FORMATETC structure I like this one because it seems to check for text, which is what I want,

Re: $$Excel-Macros$$ IF statement to test if Excel Clipboard is Empty

2010-01-27 Thread ankur
hi xlcpa check this one, may be it help you Dim MyData As DataObject Sub C() Dim stext Set MyData = New DataObject ' Put something on the Clipboard Range("a1").Copy ' Kill 'marching ants' Application.CutCopyMode = False ' Get it back MyData.GetFromClipboard

RE: $$Excel-Macros$$ IF statement to test if Excel Clipboard is Empty

2010-01-26 Thread Dave Bonallack
Hi XLCPA, I don't know a quick method of doing this, although there may be one. However, to test for an empty clipboard, you could paste to an unused cell, then test the cell. To clear the clipboard you could Copy a blank cell, then use Application.CutCopyMode = False Just some ideas. Regar