excel vba - VBA - System does not support the specified encoding -


run-time error '--1072896658 (c00ce56e)': system not support specified encoding

i'm trying pull pricing data website: http://web.tmxmoney.com/pricehistory.php?qm_symbol=^ttut. keep getting error "run-time error '--1072896658 (c00ce56e)': system not support specified encoding".

i've used code provided below pull html data websites. 1 1 gives me error. think possible i'm getting error because website uses javascript, i'm not sure. has "tags" layout of webpage. can pull using code first tag titled "quote" (http://web.tmxmoney.com/quote.php?qm_symbol=^ttut) not other tabs.

 option explicit    sub test_pull()      dim look_string string     dim web_html string     dim http_obj new msxml2.xmlhttp60      dim xa long     dim xb long      select case http_obj.status        case 0: web_html = http_obj.responsetext        case 200: web_html = http_obj.responsetext **'the error caused here**        case else: goto error_label:     end select      look_string = "quote-tabs-content"     xa = iif(isnumeric(look_string), look_string, instr(web_html, look_string))     xb = iif(xa + 32767 <= len(web_html), 32767, len(web_html) - xa + 1)     web_html = mid(web_html, xa, xb)    error_label:    end sub 

can please me figure out

  1. why happening
  2. how can pull pricing data

it huge help!!! thanks!!!

it's not you, it's them.

the response headers page causing error specify encoding doesn't exist: iso-8559-1. iso 8559 has nothing text encoding - relates sizing of clothes. should iso-8859-1 instead.

chrome developer tools window showing response headers webpage. encoding of iso-8559-1 circled in red

the quote page being read has correct iso-8859-1 encoding.

to around issue, use responsebody property contains raw bytes before decoding. strconv function can attempt convert bytes unicode string (although might not produce correct results in cases), this:

case 200: web_html = strconv(http_obj.responsebody, vbunicode)


Comments