Given that this works:
MyObject.MyMethod ("foo","bar")
this would work:
str1 = "foo"
str2 = "bar"
MyObject.MyMethod (str1,str2)
but this will not:
str1= Chr(34) & "foo" & Chr(34) & "," & Chr(34) & "bar" & Chr(34)
MyObject.MyMethod (str1)
even though str1 = "foo","bar" it is still one *parameter* being passed to MyMethod.
I get all that.
I have a COM object with a Method that takes between one and an infinite number of parameters. (like giving a DOS COPY command a list of
filenames.) I need to loop trough a dataset and assemble a list of these parameters (but obviously not as ONE STRING) and the call the method.
So i have a dataset that looks like:
"foo","12"
"bar","43"
"foo2" "89"
and need to build
MyObject.MyMethod ("foo","12","bar","43","foo2","89")
I can handle the DO...LOOP but how do I give that parameter LIST to the method?
wait, is THIS what an *array* is for? (I've heard of those, actually used one ONCE in python) if yes, how do I used it in VBA?
aha TIA
Roger
MyObject.MyMethod ("foo","bar")
this would work:
str1 = "foo"
str2 = "bar"
MyObject.MyMethod (str1,str2)
but this will not:
str1= Chr(34) & "foo" & Chr(34) & "," & Chr(34) & "bar" & Chr(34)
MyObject.MyMethod (str1)
even though str1 = "foo","bar" it is still one *parameter* being passed to MyMethod.
I get all that.
I have a COM object with a Method that takes between one and an infinite number of parameters. (like giving a DOS COPY command a list of
filenames.) I need to loop trough a dataset and assemble a list of these parameters (but obviously not as ONE STRING) and the call the method.
So i have a dataset that looks like:
"foo","12"
"bar","43"
"foo2" "89"
and need to build
MyObject.MyMethod ("foo","12","bar","43","foo2","89")
I can handle the DO...LOOP but how do I give that parameter LIST to the method?
wait, is THIS what an *array* is for? (I've heard of those, actually used one ONCE in python) if yes, how do I used it in VBA?
aha TIA
Roger