#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default DDE and VBA

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<homeID <PASTE<GO<COPY")
Call DDETerminate(ch)

TextBox1.Paste

End Sub
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"