Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 27th, 2003, 03:59 PM
Registered User
 
Join Date: Oct 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing an Array of Strings to a WebService

How do you pass an array of strings to a webservice?

I have a Webservice that takes in an array of strings and return a concatination of these strings:

<WebMethod()> _
    Public Function HelloWorld(ByVal the() As String) As String
        Dim rtn As String = ""
        Dim i As Integer
        For i = 0 To the.Length
            rtn = the(i).ToString & " " & rtn
        Next
        Return rtn
    End Function

I want to use an excel XP worksheet to call this webservice:

Private Sub CommandButton1_Click()
    Dim ExampleVar As New clsws_Service1
    Dim rtn As String
    Dim stringPassed(1) As String
    stringPassed(0) = "Hello"
    stringPassed(1) = "World"

    rtn = ExampleVar.wsm_Test(stringPassed)
    MsgBox (rtn)
End Sub

Currently it is telling me that I have a compile error because the type is mismatched. Can anyone help?






Similar Threads
Thread Thread Starter Forum Replies Last Post
strings as array indexes cwalton Excel VBA 3 July 30th, 2007 02:50 AM
Array of Strings to dll jjd Excel VBA 2 February 26th, 2006 07:25 AM
Array of Strings jjd Visual C++ 1 June 23rd, 2005 02:56 PM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM
Sorting Array of date strings Arsi C# 4 October 22nd, 2004 04:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.