I have a VB Application that communicates with Excel using DDE to pass data to excel. I use the code below and it works fine and outputs the data to Sheet1.
Text1.LinkMode = 0
Text1.LinkTopic = "Excel|test.xls"
Text1.LinkItem = "R1C2"
Text1.LinkMode = 1
Now i want to out this to Sheet2 of Excel instead of Sheet1. Can any one tell me how that can be done. I had success with something like this:
Text1.LinkTopic = "Excel|Sheet2"
but this creates a problem that if any excel file is open it outputs the data to its Sheet2.
I Also tried
Text1.LinkMode = 0
Text1.LinkTopic = "Excel|test.xls"
Text1.LinkItem = "Sheet1!R1C2"
Text1.LinkMode = 1
But it gives me an error message:
"Foreign application won't perform DDE method or operation"
Text1.LinkMode = 0
Text1.LinkTopic = "Excel|test.xls Sheet1"
Text1.LinkItem = "R1C2"
Text1.LinkMode = 1
Similarly i tried and it gives the same error.
Can anyone help me in this problem.
Text1.LinkMode = 0
Text1.LinkTopic = "Excel|test.xls"
Text1.LinkItem = "R1C2"
Text1.LinkMode = 1
Now i want to out this to Sheet2 of Excel instead of Sheet1. Can any one tell me how that can be done. I had success with something like this:
Text1.LinkTopic = "Excel|Sheet2"
but this creates a problem that if any excel file is open it outputs the data to its Sheet2.
I Also tried
Text1.LinkMode = 0
Text1.LinkTopic = "Excel|test.xls"
Text1.LinkItem = "Sheet1!R1C2"
Text1.LinkMode = 1
But it gives me an error message:
"Foreign application won't perform DDE method or operation"
Text1.LinkMode = 0
Text1.LinkTopic = "Excel|test.xls Sheet1"
Text1.LinkItem = "R1C2"
Text1.LinkMode = 1
Similarly i tried and it gives the same error.
Can anyone help me in this problem.