N
nettid1
Hello,
I'm trying to get the clipboardData.setData and clipboardData.getData
commands to work in some Excel (2000) code, and I can't; I've tried
googling and the help files, but no luck. I'm just looking to examine
the clipboard then reset it.
To try to get something working I've done this:
test_variable = document.parentwindow.clipboardData.GetData("Text")
MsgBox (test_variable)
and variations on a theme such as
test_variable = clipboardData.GetData("Text")
test_variable = me.clipboardData.GetData("Text")
but I can't seem to get anything working. Up until now, I've been using
a hack I found at
http://www.microsoft.com/technet/scriptcenter/resources/qanda/aug04/hey0813.mspx
which uses the following code:
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate ("about:blank")
clipdata = objIE.document.parentwindow.clipboardData.GetData("text") '
grab clipboard data
objIE.document.parentwindow.clipboardData.setData "text", "
" ' reset clipboard
objIE.Quit
This appears to work, though I have recently discovered problems with
the code that uses it (which is a dodgy hack in itself using WSH to
cotrol an in-house application) which implies that the clipboard is not
being cleared.
Unfortunately, where I work I don't have the facilities to run this in
a test environment, so my testing is very limited. If I can eliminate
problems with the IE hack then that will help me narrow things down.
Many thanks,
-zoara-
I'm trying to get the clipboardData.setData and clipboardData.getData
commands to work in some Excel (2000) code, and I can't; I've tried
googling and the help files, but no luck. I'm just looking to examine
the clipboard then reset it.
To try to get something working I've done this:
test_variable = document.parentwindow.clipboardData.GetData("Text")
MsgBox (test_variable)
and variations on a theme such as
test_variable = clipboardData.GetData("Text")
test_variable = me.clipboardData.GetData("Text")
but I can't seem to get anything working. Up until now, I've been using
a hack I found at
http://www.microsoft.com/technet/scriptcenter/resources/qanda/aug04/hey0813.mspx
which uses the following code:
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate ("about:blank")
clipdata = objIE.document.parentwindow.clipboardData.GetData("text") '
grab clipboard data
objIE.document.parentwindow.clipboardData.setData "text", "
" ' reset clipboard
objIE.Quit
This appears to work, though I have recently discovered problems with
the code that uses it (which is a dodgy hack in itself using WSH to
cotrol an in-house application) which implies that the clipboard is not
being cleared.
Unfortunately, where I work I don't have the facilities to run this in
a test environment, so my testing is very limited. If I can eliminate
problems with the IE hack then that will help me narrow things down.
Many thanks,
-zoara-