M
Mark S
I am trying to get text from copied cells through the clipboard and after
reading the text into an array and some manipulation to the text be able to
write the new text back to a range of cells.
I have written everything except for the part that writes it back and it
works fine in the VB editor. But if I try to run the macro (sub) from Tools
on the worksheet I get run-time error DataObject:GetText Invalid FORMATETC
structure.
My code is centered on the following lines:
dObj.GetFromClipboard
s = dObj.GetText(1)
The error occurs on the GetText line.
Reference to Microsoft Forms 2.0 Object Library is checked.
Again, it works fine from the editor and I am able to Debug.Print the
elements of the array without a problem. But if I run the same Macro from
the worksheet, then no joy.
Any ideas? What if I put the code into a function and just have a the sub
procedure making the Call and then writing the results back where I want it?
Any help is appreciated.
reading the text into an array and some manipulation to the text be able to
write the new text back to a range of cells.
I have written everything except for the part that writes it back and it
works fine in the VB editor. But if I try to run the macro (sub) from Tools
on the worksheet I get run-time error DataObject:GetText Invalid FORMATETC
structure.
My code is centered on the following lines:
dObj.GetFromClipboard
s = dObj.GetText(1)
The error occurs on the GetText line.
Reference to Microsoft Forms 2.0 Object Library is checked.
Again, it works fine from the editor and I am able to Debug.Print the
elements of the array without a problem. But if I run the same Macro from
the worksheet, then no joy.
Any ideas? What if I put the code into a function and just have a the sub
procedure making the Call and then writing the results back where I want it?
Any help is appreciated.