Ed White
2007-03-16 14:57:08 UTC
I have an application where I copy data onto the clipboard from Excel, and
then read the data from the clipboard in my application. This worked fine
until recently, where inexplicably, everytime I use the command to read the
clipboard, it comes up blank (Nothing or ""). For example,
Dim clipbdStr as String 'in declarations
'in both all of the following, clipbdStr returns Nothing
clipbdStr=My.Computer.Clipboard.GetText
clipbdStr=Clipboard.GetText
I am certain the clipboard has something in it before excuting the above, as
in Debug mode I can paste the contents onto Notepad before stepping through
the above commands, and I can as well see the area of Excel highlighted with
moving dashes around it.
I saw in the help menus something about permissions, although the
instructions to change them apply only to .Net 1 and I have .Net 2.
Why can't I read the clipboard anymore? I have the latest version of VB 2005
(SP.050727-7600). I can't tell what I changed since the last time I tried to
run this section of the code.
then read the data from the clipboard in my application. This worked fine
until recently, where inexplicably, everytime I use the command to read the
clipboard, it comes up blank (Nothing or ""). For example,
Dim clipbdStr as String 'in declarations
'in both all of the following, clipbdStr returns Nothing
clipbdStr=My.Computer.Clipboard.GetText
clipbdStr=Clipboard.GetText
I am certain the clipboard has something in it before excuting the above, as
in Debug mode I can paste the contents onto Notepad before stepping through
the above commands, and I can as well see the area of Excel highlighted with
moving dashes around it.
I saw in the help menus something about permissions, although the
instructions to change them apply only to .Net 1 and I have .Net 2.
Why can't I read the clipboard anymore? I have the latest version of VB 2005
(SP.050727-7600). I can't tell what I changed since the last time I tried to
run this section of the code.
--
Ed
Ed