VBA example codes

647 views
Skip to first unread message

Amir Tabatabaei

unread,
Dec 19, 2014, 9:08:58 AM12/19/14
to octopa...@googlegroups.com
Hi,

Are there any VBA example code for part search? 

Andres Morey

unread,
Dec 19, 2014, 10:45:04 AM12/19/14
to octopa...@googlegroups.com
Hi Amir,

We have VB.NET examples in the documentation:

Hope that helps!

Andres


On Fri, Dec 19, 2014 at 9:08 AM, Amir Tabatabaei <amiro...@gmail.com> wrote:
Hi,

Are there any VBA example code for part search? 

--

---
You received this message because you are subscribed to the Google Groups "Octopart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to octopart-api...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

zaplong

unread,
Jan 8, 2015, 7:30:26 AM1/8/15
to octopa...@googlegroups.com
Hi Amir,
 
Took me a while to figure this out too! Try the following (using Excel, not tried it in Access):
 
    Dim XML
    Dim strResult As String
    Dim strPartNo As String
    
    strPartNo = "manufacturer_part_no"

    Set XML = CreateObject("MSXML2.XMLHTTP")
    XML.Open "GET", "http://octopart.com/api/v3/parts/match?apikey=MY_API_KEY&queries=[{""mpn"":""" & strPartNo & """,""limit"":20}]&pretty_print=true"
    XML.send
 
The result takes a few milliseconds to come through, so you'll either need to wait a set time, or create a loop as I've done below:

    strResult = ""

myLoop:
    On Error Resume Next
   
    strResult = XML.responsetext
    If Err.Number = -2147483638 Then
        DoEvents
        GoTo myLoop
    Else
        strResult = XML.responsetext
    End If
 
Hope this helps.

Mike Nguyen

unread,
Apr 5, 2016, 10:08:36 AM4/5/16
to Octopart API
Is there a desktop API or library that I can connect to?  

andres

unread,
Apr 8, 2016, 10:50:37 AM4/8/16
to Octopart API
Hi Mike,

The Octopart API is a REST API that you can query by making HTTP requests from a client-side app to our servers.  What are you trying to build using the Octopart API?

Andres

Mike Nguyen

unread,
Apr 8, 2016, 7:28:35 PM4/8/16
to Octopart API
Im just starting with the basics and getting part descriptions based on Manufacturer P/N and Manufacturer.  As i just spent three hours copy and pasting part descriptions.  I'm an ex-VB.NET developer.  any help would be great.  sometimes my list could be 50 but today was 400 P/N long!
Reply all
Reply to author
Forward
0 new messages