Simple String Question

  • Thread starter Thread starter pete3589
  • Start date Start date
P

pete3589

I have a VBA application that needs to look at a certain cell in orde
to identify the topic for DDE communications. I think I am somehow no
declaring my string properly.

Dim Array1 As Integer
Dim Row As Integer
Dim AnInput As Integer
Dim DDETopic As String


DDETopic = Worksheets("Set Points").Range("L4").Value

Import = DDEInitiate("RSLinx", "DDETopic")

Where DDE Topic is the value in cell L4 of sheet "Set Points". When
run the macro it gives me an error that says RSLinx isnt running.
However, if i just put the correct topic name in place of DDETopi
everything works fine. Am I declaring the string DDETopic correctly
 
You are certainly declaring it as a string, but it is the next line that is
wrong, it should be

Import = DDEInitiate("RSLinx", DDETopic)

otherwise you are passing the string value DDETopic, not the value of the
variable DDETopic.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Thanks for the help, that appears to have worked, except now I get
popup that asks what DDE link to use, and it gives me some pre-existin
links that I have created using my DDE client (RSLinx).

This is probably a long shot, but does anyone know how to not have thi
pop up and just use the exact text that is shown in the given cell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top