Jump to content
Macro Express Forums

I'm just learning and I really need help!


Recommended Posts

I need to take the filename from a column in excel, make it part of a url, go to that url, get the title of the page and bring that info back to excel and put it next to the original filename. I need to do this for a list that has 1000s of filenames in it. Here's an example:

 

the list has filenames like this:

 

x123

y1234

z12

 

For the first one, I'd put that filename at the end of a url like this:

 

http:\\www.example.com\x123.htm

 

I'd go to that url and when the page opens, I need to get the title of the page, which would be:

 

"x123-08 These Are Extra Words in the Title that I don't Need but I Can Deal With Later"

 

The part I am really trying to get is the x123-08 but I would settle for the whole title if necessary and remove the rest in a different step.

 

I would like to copy this back to my excel file in the cell next to the original, like this:

 

x123 ____ x123-08

y1234

z12

 

Then I need to go on to y1234 and do the same process.

 

So, I know each step that I need to do. I just don't know how to do some of them...like variables, I'm not sure how to move down the list and do the process for each one.

 

You have no idea how much I would appreciate any help with this.

 

Thanks in advance!

Link to comment
Share on other sites

I wouldn't use Excel. Check out the ASCII File Process or Text File Process commands. Create a simple text file with that list and run it that way. Then when you get the window title (Variable Set String > Set Value to Topmost Window Title) write it to a file (Variable Modify String > Append to Text File. w/CR/LF). When you are done paste the two side by side in Excel. Might look something like this:

<BTFBEG:001:000001:000000:c:\list.txt><HTTP2:1:T:http:\\www.example.com\%T1%.htm><TVAR2:02:06:><WCLS:"CURRENT"><IVAR2:01:13:2: ><TMVAR2:11:02:00:N01:999:><TMVAR2:20:01:00:000:000:c:\list-output.txtT><BTFEND>

You can copy this chunk and paste it directly into the Scripting Editor. You might need to add some delays for timing. Assuming the first space marks the end of what you want I trimmed off the rest of the title in the macro.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...