R
Rene
Hi,
I am trying to paste screens from bloomberg into textboxes
in vba so that I can then parse it. But I keep getting
this error in MS VB that says "Automation error", "The
object invoked has disconnected from its clients."
Below is the particular code that is causing the error.
It is strange because if I seperate the Textbox1.paste
into a different button and click that manually no error
shows up, but if I put all this code together, or include
code that calls the click function automatically, I get
the error. Also, when I manual paste it into the text box
with ctrl-v it works fine. Does anyone know what the
problem might be and how to get around it?
Thanks!
Rene
Sub CommandButton5_Click()
'test button
Worksheets("Main").Cells(20, 2).Copy
Dim ch As Long
ch = DDEInitiate("winblp", "bbk")
Call DDEExecute(ch, "<blp-1><home>ID <PASTE><GO><COPY>")
Call DDETerminate(ch)
TextBox1.Paste
End Sub
I am trying to paste screens from bloomberg into textboxes
in vba so that I can then parse it. But I keep getting
this error in MS VB that says "Automation error", "The
object invoked has disconnected from its clients."
Below is the particular code that is causing the error.
It is strange because if I seperate the Textbox1.paste
into a different button and click that manually no error
shows up, but if I put all this code together, or include
code that calls the click function automatically, I get
the error. Also, when I manual paste it into the text box
with ctrl-v it works fine. Does anyone know what the
problem might be and how to get around it?
Thanks!
Rene
Sub CommandButton5_Click()
'test button
Worksheets("Main").Cells(20, 2).Copy
Dim ch As Long
ch = DDEInitiate("winblp", "bbk")
Call DDEExecute(ch, "<blp-1><home>ID <PASTE><GO><COPY>")
Call DDETerminate(ch)
TextBox1.Paste
End Sub