Click here to Skip to main content
11,632,778 members (80,894 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: XML Excel VBA WebService

Right now I can post 1 xml record to a web service via Excel and a few lines of code using the, "MSDN Web Services Toolkit 2.0" but I need the ability to post about 100 records at a time.


- So I think I need a vba loop with "pauses" because I think the web service "response" needs to be removed/cleared out after xml each record is posted.

- I need an approach to call the XML Data for about 100 records:
either I need to call the data off the second Excel tab that has a XSD applied to it (note, the XSD excel produces is slightly off so that concerns me) or
I need to call a text file that has all the XML data or another way?

Trying to keep this dirt simple to import some data into an application via a web service from an Excel Sheet. The toolkit did most of the heavy lifting now I just need a way to loop through 100 records.


**Code so far that posts 1 record:**

    Private Sub insPat_Click()
    Dim info As New clsws_FDirect
    Dim addpat As String
    Dim response As String
    addpat = Range("B10").Text
    response = info.wsm_PatientAdd(addpat)
    Set responserange = Range("B11")
    responserange.Value = response
    End Sub

**Correct XSD:**

[EDIT]I have made some corrections - LOSMAC[/EDIT]
Posted 21-Jan-12 5:46am
Edited 7-Feb-12 9:01am
Maciej Los187.2K

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You can send an entire sheet via a webservice in one call, why not do that and process on the other end ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 8,618
1 Sergey Alexandrovich Kryukov 8,189
2 Mika Wendelius 6,415
3 F-ES Sitecore 2,321
4 Suvendu Shekhar Giri 2,075

Advertise | Privacy | Mobile
Web03 | 2.8.150728.1 | Last Updated 7 Feb 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100