Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default declaration help please

a third party added some code to one of my apps and didn't dim anything. i'm
not sure how to dim these variables. can someone help?

a couple examples in the code:

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Sched_New" 'Tag in CompactLogix

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Schedule[" & Num_i & "],L1,C1" 'Schedule Tag in
CompactLogix
--


Gary Keramidas
Excel 2003


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default declaration help please

Gary,

I never used DDE, it's outdated.
DDEItem is obviously a string, and F1 used with DDEInitiate tells me:
"If successful it returns the number of the DDE channel".
So a Long would be fine.
If you can't figure out what type to use (remember: F1 is your friend),
you can always stay with Variants (as they did).

Helmut.


"Gary Keramidas" schrieb im Newsbeitrag
...
a third party added some code to one of my apps and didn't dim anything. i'm
not sure how to dim these variables. can someone help?

a couple examples in the code:

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Sched_New" 'Tag in CompactLogix

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Schedule[" & Num_i & "],L1,C1" 'Schedule Tag in
CompactLogix
--


Gary Keramidas
Excel 2003




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default declaration help please

thanks for the info. it's outdated and so was a lot of their other code.
they were selecting everything in the code an i re-wrote a lot of it,
dimming the variables, too.

--


Gary Keramidas
Excel 2003


"Helmut Meukel" wrote in message
...
Gary,

I never used DDE, it's outdated.
DDEItem is obviously a string, and F1 used with DDEInitiate tells me:
"If successful it returns the number of the DDE channel".
So a Long would be fine.
If you can't figure out what type to use (remember: F1 is your friend),
you can always stay with Variants (as they did).

Helmut.


"Gary Keramidas" schrieb im Newsbeitrag
...
a third party added some code to one of my apps and didn't dim anything.
i'm not sure how to dim these variables. can someone help?

a couple examples in the code:

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Sched_New" 'Tag in CompactLogix

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Schedule[" & Num_i & "],L1,C1" 'Schedule Tag in
CompactLogix
--


Gary Keramidas
Excel 2003





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default declaration help please

You can probably ask VB to tell you. Put this line after after the first
line...

MsgBox TypeName(DDEChannel)

and put this after the second line...

MsgBox TypeName(DDEItem)

and so on... VB should tell you what Data Type is stored in the Variants and
you can then Dim each of those variables accordingly.

--
Rick (MVP - Excel)



"Gary Keramidas" wrote in message
...
a third party added some code to one of my apps and didn't dim anything.
i'm not sure how to dim these variables. can someone help?

a couple examples in the code:

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Sched_New" 'Tag in CompactLogix

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Schedule[" & Num_i & "],L1,C1" 'Schedule Tag in
CompactLogix
--


Gary Keramidas
Excel 2003


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default declaration help please

ok, thanks.

--


Gary Keramidas
Excel 2003


"Rick Rothstein" wrote in message
...
You can probably ask VB to tell you. Put this line after after the first
line...

MsgBox TypeName(DDEChannel)

and put this after the second line...

MsgBox TypeName(DDEItem)

and so on... VB should tell you what Data Type is stored in the Variants
and you can then Dim each of those variables accordingly.

--
Rick (MVP - Excel)



"Gary Keramidas" wrote in message
...
a third party added some code to one of my apps and didn't dim anything.
i'm not sure how to dim these variables. can someone help?

a couple examples in the code:

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Sched_New" 'Tag in CompactLogix

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Schedule[" & Num_i & "],L1,C1" 'Schedule Tag in
CompactLogix
--


Gary Keramidas
Excel 2003





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default declaration help please

I'd say Variant; slower but works for everything.


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Rick Rothstein" wrote:

You can probably ask VB to tell you. Put this line after after the first
line...

MsgBox TypeName(DDEChannel)

and put this after the second line...

MsgBox TypeName(DDEItem)

and so on... VB should tell you what Data Type is stored in the Variants and
you can then Dim each of those variables accordingly.

--
Rick (MVP - Excel)



"Gary Keramidas" wrote in message
...
a third party added some code to one of my apps and didn't dim anything.
i'm not sure how to dim these variables. can someone help?

a couple examples in the code:

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Sched_New" 'Tag in CompactLogix

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Schedule[" & Num_i & "],L1,C1" 'Schedule Tag in
CompactLogix
--


Gary Keramidas
Excel 2003


.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default declaration help please

Personally, I dislike Variants... you end up trusting VB to handle all the
behind the scene conversions for you. Do you think that is necessarily a
good thing to do? Lets say we have these two variant assignments...

V1 = "123"
V2 = "456"

What do you think this line will display...

MsgBox V1 + V2

--
Rick (MVP - Excel)



"ryguy7272" wrote in message
...
I'd say Variant; slower but works for everything.


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Rick Rothstein" wrote:

You can probably ask VB to tell you. Put this line after after the first
line...

MsgBox TypeName(DDEChannel)

and put this after the second line...

MsgBox TypeName(DDEItem)

and so on... VB should tell you what Data Type is stored in the Variants
and
you can then Dim each of those variables accordingly.

--
Rick (MVP - Excel)



"Gary Keramidas" wrote in message
...
a third party added some code to one of my apps and didn't dim
anything.
i'm not sure how to dim these variables. can someone help?

a couple examples in the code:

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Sched_New" 'Tag in CompactLogix

DDEChannel = Application.DDEInitiate(app:="RSLinx", topic:="T09113")
DDEItem = "Xfer_Schedule[" & Num_i & "],L1,C1" 'Schedule Tag in
CompactLogix
--


Gary Keramidas
Excel 2003


.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boolean Declaration Shatin[_2_] Excel Programming 4 March 12th 08 04:39 PM
if declaration ashw1984 Excel Programming 2 January 30th 06 07:35 PM
Declaration name Robert Hargreaves[_2_] Excel Programming 4 June 6th 05 04:48 PM
which declaration to use Peer Excel Programming 3 August 2nd 04 03:17 PM
Declaration? TJF[_2_] Excel Programming 5 December 18th 03 03:26 PM


All times are GMT +1. The time now is 04:27 AM.

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

About Us

"It's about Microsoft Excel"