[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 420
  • Last Modified:

How can I pass an array to a VB.net COM object from Javascript or VBScript? The COM object is expecting a value AS STRING()

The VB.net COM Object is expecting a  value AS STRING()

For example:
VB.NET code
'Message  is the value to pass
Public Function MyFunction(ByVal ObjectName As String, ByVal EventName As String, ByVal Message As String())

Javascript code:
//oCIC is the reference to the object
oCIC.MyFunction(ObjectName, EventName, ?????);

Or it could be in VBScript.
I will appreciate any help.
  • 3
  • 3
1 Solution
Pawel WitkowskiSenior Javascript DeveloperCommented:
If you have to use String then use Javascript built in function for Array: split and join:

before sending just do:


after retrieving you can do:


Is that somehow helpful ?
amontesAuthor Commented:
Thanks wilg32...

My problem is that COM Object is over 300 computers, for right now, changing the COM object is out of the question, I created it about 3 years ago and it has been working with out issues.

For what I have read, it seams that there is no way to use this function since it has a "VAR as STRING()" array.
Pawel WitkowskiSenior Javascript DeveloperCommented:
Well what I propose is just to use string as a serializer of array, but if you cant use it that way so there will be no other possibility unfortunately :(
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

amontesAuthor Commented:
Thanks any way...

So, I do not know what to do next, should I accept your answer as an option even though it did not solve my issue?

Pawel WitkowskiSenior Javascript DeveloperCommented:
You dont have to, just close question
amontesAuthor Commented:
This is the best way to pass an array from JavaScript to a COM Object if building a COM object or updating it is the option.  In my case, I could not update the COM object and for what it seams, there is not way to pass an array from JavaScript.

Thanks wilq32.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now