Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Cannot Dechiper Encoded String

Sorry, I didn't express myself clearly enough.

The value of el, as seen in the watch window in the value column, is
what I meant when I typed el.value. I'm actually accessing "el", not
"el.value'. I apologize for the confusion.

Also, I recently realized that the debug window is showing
?subject=Got%20ize %20" for el, whereas
when I look at the web page source, that same line of data that I'm
capturing as "el", shows up as:Gov't Seized

So that explains why it's not working for me. By the time the
datastring is captured by a variable something has already discarded
the characters that need translating.

I'm getting el this way:

Set IeDoc = obIe.document
el = IeDoc.getElementsByTagName("HR")
el = el.nextSibling.nextSibling

Here's where I started to copy the data from the web page source, and
that's when I realized - the data I'm trying to translate doesn't
exist in the line of data I'm capturing! It had already been
removed! No wonder it didn't work!

So, from there it was easy to figure out. I needed to grab that data
from a different element. And I did. And now it works.

Many thanks to both of you for your help, you led me to the actual
problem. Couldn't of done it without either of you.


On Nov 16, 9:40*am, Ron Rosenfeld wrote:
On Sun, 16 Nov 2008 09:00:24 -0800 (PST), Dudely wrote:
The string value of el is composed of letters & numbers that make up
an email address, +1. *It comes in the form of: **@*.* and is composed
of a random number of characters followed by ?subject= followed by the
actual subject string. *The value of theSpot is equal to the number of
characters in the email address. *If in fact the email address were
, then the corresponding values would be:


?subject=B ank
Seized
theSpot=the number of characters between the start of the value and
the word "subject" and is obtained by the expression: theSpot = InStr
(el, "subject")
The subject string=Bank Seized


I suspect something odd about the code you have not posted. *Perhaps if you
posted all of your code, and not just bits and pieces, it might be helpful.

The following seems to work as expected:

=====================
Option Explicit
Const e1 As String = _
?subject=Bank Seized"

Sub foo()
Dim SubjectString As String
Dim i As Long
Dim theSpot As Long
* * theSpot = InStr(e1, "subject")
* * SubjectString = Mid(e1, theSpot + 8)

For i = 32 To 127
* * SubjectString = Replace(SubjectString, "&#" & i & ";", Chr(i))
Next i

Debug.Print SubjectString

End Sub
====================
--ron


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create dialog box that will post to worksheet encoded data? joromajr Excel Discussion (Misc queries) 1 November 1st 09 12:16 PM
Excel docs opening encoded jackievar Excel Discussion (Misc queries) 3 November 10th 07 08:40 PM
Opening UTF8-encoded CSV file (Excel 2004 for Mac) Antonio[_2_] Excel Discussion (Misc queries) 2 October 30th 07 10:30 PM
How to open a UTF-8 encoded CSV file in Excel Elayaraja Excel Discussion (Misc queries) 3 April 18th 06 11:26 AM
Importing UTF-8 Encoded CSV Files. Problem Rob[_12_] Excel Programming 0 September 4th 03 12:59 PM


All times are GMT +1. The time now is 04:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"