called DDEEXAM4.WAS that should be able to help you. That shows you how to place something in an Excel cell and you should be able to modify it to locate a particular cell.
The Easy way to understand the relationship is in the Excel "Grid"..
Excel works with Rows and Columns. The Rows are Numbered 1 thru the end of the Spreadsheet. Example 1 thru 3276.
The Columns are Lettered A -> Z then AA - ZZ, etc.
R1C1 is Row 1 Column A
R1C2 is Row 1 Column B
R2C1 is Row 2 Column A
R2C26 is Row 2 Column Z
R2C27 is Row 2 Column AA
Knob's Website has Several examples that I wrote using DDE to Excel that will show how to increment the Rows and Columns when using DDE.
When I use dde to do a 'FIND.CELL' operation, it finds the data and Excel visually shows it as the currently selected cell on the spreadsheet. What I need to know is how will the cell's location information get back to Procomm so that I can do a DDEREQUEST for the contents in that cell?
One of the scripts I wrote that is on Knobs website deals with extracting the Data from Excel and sending it to a Text file. This might give you some ideas.
You may even have to write an Excel Macro that will get the Cell Data and have Excel set up a Link to Procomm to Send the Data. I had some problems with extracting the Data via a Procomm DDEREQUEST Command.
I'll look back and see what I can find in some test Scripts.
Hank, one thing I had been working on via email (haven't had time to get back to it yet) was issuing the Selection() or Active.Cell() commands, but wasn't able to get a value returned back to Procomm. You may want to try working your Excel magic with those commands and see if you are able to come up with a solution?
According to the information I've come up with via the Excel DDE Help File, None of the functions return a value.
I did create an Excel Macro that stored the Size of a Cell and put the value into a Cell I selected. I could then retrieve this info.
As you can see, you have to know which Cell Reference you want data from. I suppose if an Excel Sheet kept a standard format, you could do a Strcmp with a Cell Contents and based on what is there, change the Row and Column for another DDEREQUEST for another Cell.
I think you would have better luck asking in one of the Tek-Tips forums that covers Office and see if someone there knows of the necessary command for Procomm to send. I did a lot more digging on this and couldn't find a built-in Excel command that will return the selected cell in RnCn format. The two commands I mentioned earlier don't return the current cell in that format and I'm having no luck getting that data back to Procomm, although the same command works OK in Excel.
I've been work on this for a few days now, and I'm close to a solution. Once the Active Cell is Located, Excel sets a DDE connection back to Procomm, and sends back the Location of the Cell to Procomm. If the Cell Needs to be in the Form of R1C1, that should not be a problem.
Here is a Simple Macro that Can be inserted into a Spreadsheet. You'll need to work on the Code for Checking when the Next FIND.CELL is Called.
Sub DDE_Act_Cell()
Dim ActCell As String
Dim Chan As Long
Dim Data As String
ActCell = Application.ActiveCell.Address(, , xlR1C1)
Chan = DDEInitiate("PW5", "system"
Chan = DDEInitiate("PW5", "Hello.wax"
Range("AJ8".Value = ActCell
DDETerminate Chan
End Sub
Note that My Script was Called "Hello.wax". Also I used
Cell AJ8 to hold the Active Cell Location. You'll have to have Procomm go to that Location to Extract your Data.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.