Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is "DDEInitiate" possible in VB5?

Status
Not open for further replies.

bnath001

Programmer
Aug 18, 2000
100
US
Hi,

I need some urgent help..
I am trying to use DDEInitiate command to invoke Excel from VB5.0. I am able to use this successfully from Access97 but I do not know if I can use in VB5.0

could some suggest me please

nath
 


Hi nath

Not sure if DDEInitiate is available within VB - but you can certainly add a reference to Excel (for instance) and use Excels DDE facilities from VB.


Stew
 
DDE is available in VB and has been since V3. You initiate a DDE convesation by using the LinkTopic which sets the source appication and Topic. The other properties to use for DDE conversations are LinkItem / LinkMode and LinkTimeout.

Hope this helps,

Chris Dukes
 
cdukes, I am using VB5 and what library should I include in my project file inorder to make use of DDEInitiate call..

thank u
nath
 
Nath,

Do do not need to include any libraries. The properties are available on standard text boxes. Add a text box to a VB form. The following links to a Word Document:


Text1.LinkMode = 0
Text1.LinkTopic = "Excel|MyBook.xls"
Text1.LinkItem = "R1C1:R2C3"
Text1.LinkMode = 1

'Poke the text in Text1 to the R1C1:R2C3 in MyBook.xls
Text1.Text = "one" & vbTab & "two" & vbTab & "three" & vbCr & _
"four" & vbTab & "five" & vbTab & "six"
Text1.LinkPoke

'Execute commands to select cell A1 (same as R1C1) and change the font
'format
Text1.LinkExecute "[SELECT(""R1C1"")]"
Text1.LinkExecute "[FONT.PROPERTIES(""Times New Roman"",""Bold"",10)]"

'Terminate the DDE communication
Text1.LinkMode = 0

You must excuse me, as this has been pasted directly from MSDN. For more info lookup LinkTopic in MSDN.

Hope this helps,

Chris Dukes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top