Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2007

Tip: Looking for answers? Try searching our database.

vba reference...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
orbii - 07 Jan 2007 16:54 GMT
is it possible or a reference to allow me to extract data from a html
file...  example, i needed my vba code to return me all href and src attribs
values from a few selected tags.  do i have to clearly write a code from
scratch?  someone in my office said to look up on DOM, something on object
model or something, but non of us here know enough about vba to make a clue
in the vast sea of tech abbriviation.

could someone point me in a direction?  anything that helps would be greatly
appriciated.

ps: could anyone past a small code that would allow me to open a simple text
file and pull in data to excel line by line?  the help file on excel vba
arn't too helpful like php...

aloha, orbii
Martin Fishlock - 07 Jan 2007 23:29 GMT
The DOM (Document Object Model) is a W3C project (see http://www.w3.org/DOM/ 
) and AFAIK won't help you here.

The general process for the reading files is:

Sub processfile()
Dim s As String
Dim lRow As Long
Open "filename.html" For Input As #1
Do While Not EOF(1)
   lRow = lRow + 1
   Line Input #1, s
   Cells(lRow, 1) = s
Loop
Close #1
End Sub

Signature

Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.

> is it possible or a reference to allow me to extract data from a html
> file...  example, i needed my vba code to return me all href and src attribs
[quoted text clipped - 11 lines]
>
> aloha, orbii
Martin Fishlock - 07 Jan 2007 23:31 GMT
Sorry I forgot to mention that this is quite a difficult process to parse an
HTML file as attributes don't have to be an the same line and can be split.

But it can be done.

Signature

Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.

> is it possible or a reference to allow me to extract data from a html
> file...  example, i needed my vba code to return me all href and src attribs
[quoted text clipped - 11 lines]
>
> aloha, orbii
orbii - 08 Jan 2007 05:13 GMT
hi martin, thank you so much for your info.  i might just go the php route
by using excel to trigger php then spit the file back.  but your info is
very much helpful.

btw, what is AFAIK?  and how do i rate this reply?

aloha orbii

> Sorry I forgot to mention that this is quite a difficult process to parse
> an
[quoted text clipped - 23 lines]
>>
>> aloha, orbii
orbii - 08 Jan 2007 05:31 GMT
oh i forgot to mention, we found something in vba refernce that is named
"Microsoft HTML Object Libary" this morning.

aloha, orbii

> Sorry I forgot to mention that this is quite a difficult process to parse
> an
[quoted text clipped - 23 lines]
>>
>> aloha, orbii
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.