From: ryguy7272 on 27 Apr 2010 19:45 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" <gkeramidas(a)MSN.com> wrote in message > news:e#t9chk5KHA.5476(a)TK2MSFTNGP06.phx.gbl... > > 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 > > > > > . >
From: Rick Rothstein on 27 Apr 2010 22:32
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" <ryguy7272(a)discussions.microsoft.com> wrote in message news:5FDF6FA8-7629-4095-B287-7F1C52F8885A(a)microsoft.com... > 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" <gkeramidas(a)MSN.com> wrote in message >> news:e#t9chk5KHA.5476(a)TK2MSFTNGP06.phx.gbl... >> > 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 >> > >> > >> . >> |