<?xml version="1.0" encoding="utf-8"?><GetOrdersRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<!-- Call-specific Input Fields -->
<IncludeFinalValueFee>true</IncludeFinalValueFee>
<NumberOfDays>30</NumberOfDays>
<OrderRole>Seller</OrderRole>
<OrderStatus>Completed</OrderStatus>
<SortingOrder>Ascending</SortingOrder>
<DetailLevel>ReturnSummary</DetailLevel>
<ErrorLanguage>en_US</ErrorLanguage>
<MessageID>string</MessageID>
<WarningLevel>Low</WarningLevel>
</GetOrdersRequest>
What is the exact and complete error? Which line does it happen on? If it is a run-time error, click Debug on the error message and the errant line is highlighted in yellow.When using your code, I get an error with the XMLrequest = "..." lines, as it throws an syntax error there in my VBA screen (I used the newest one you provided). Am I missing a reference or something?
'Microsoft XML v6.0
'Microsoft HTML Object Library
'Microsoft Internet Controls
What is the exact and complete error? Which line does it happen on? If it is a run-time error, click Debug on the error message and the errant line is highlighted in yellow.
Have you added the following references (via Tools -> References in the VBA editor) noted at the top of Module1?
Code:'Microsoft XML v6.0 'Microsoft HTML Object Library 'Microsoft Internet Controls
XMLrequest = "<?xml version='1.0' encoding='utf-8'?>" & _
"<GetSessionIDRequest xmlns='urn:ebay:apis:eBLBaseComponents'>" & _
"<RuName>" & RuName & "</RuName>" & _
"</GetSessionIDRequest>"
Posting the Module1 code in the forum has changed the embedded apostrophes within the "string" lines to double quotes. To fix the error, change the embedded double quotes to apostrophes, like this:
PHP:XMLrequest = "" & _ "" & _ "" & RuName & "" & _ ""
That error means the XMLnode variable is Nothing, which is caused by the previous line:The code gets to the "SessionID = XMLnode.nodeTypedValue" line and errors out. In debug mode, it states: "Run-Time error '91': Object variable or With block variable not set."
Set XMLnode = XMLresponseElement.SelectSingleNode("/a:GetSessionIDResponse/a:SessionID")
That error means the XMLnode variable is Nothing, which is caused by the previous line:
attempting to get the SessionID string from the XML response.Code:Set XMLnode = XMLresponseElement.SelectSingleNode("/a:GetSessionIDResponse/a:SessionID")
I can reproduce the error by specifying an incorrect DevID, AppID, CertID or RuName. The code contains Debug.Print statements which output to the VBA Immediate Window - press Ctrl+G in the VBA editor to display the Immediate Window. If you look in the Immediate Window after the error has occurred there is a long XML string which includes the reason for the failure. For example, for a incorrect RuName string it says "The ru_name in your request is invalid". This XML error response may help you to pinpoint the cause of your error.
Remember this code is meant to be used with the eBay sandbox and an eBay developer account. If you are trying to use it with the real eBay site then changes may be needed. Note that in the ebayUserName string used in the code, "TESTUSER_xxxxxxx", the "TESTUSER_" part was fixed and provided by eBay.
Maybe you could contact this thread's OP as his/her code works successfully.