Wow

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Yes, surely.
I hope he will always stay "simple". That's his main beauty to my sense.
 
Blew me away. And it looks like he did a pretty good job with the judges too!
EDIT: He won the final.

Denis
 
Andrew... That was the coolest thing I have ever seen.

iknowu99... That was just wrong.
 
Between the two, I would rather listen to that 'polka' than the opera dude. :p
 
Andrew, that was truely g8, WOW what talent.
It was so good I wanted to download it ... P.ssed me off that you can't.
Looked into my IE Tmp files, found it BUT was locked and removed ?? when the session was closed.

SO I got some tools together and found how to get the file.

So for any one wanting to Download off YouTube here is some code.
There are other ways BUT I'll leave that for my site.
Just change strYouTubeURL to the YouTube address of the Video eg

http://www.youtube.com/watch?v=En0A8KGMgq8

EDIT:

Code over here should work now
http://www.xcelfiles.com/YouTube.html

Disregard the code below........


Rich (BB code):
Option Explicit

Private Declare Function DoFileDownload _
    Lib "shdocvw.dll" ( _
        ByVal lpszFile As String) _
As Long

Sub DownLoadYouTubeVideo()

    '///////////////////////////////////////////////////////////////////////////////////////
    '// Routine to download Video from YouTube
    '// Requires: This project needs a reference to "Microsoft Internet Controls" and
    '//           "Microsoft HTML Object Library"
    '// Inputs: Valid YouTube address of Viewing Video
    '//       : eg. Paul Potts, 'Britains Got Talent * Paul Potts WOWS with Nessun Dorma!'
    '//       : http://www.youtube.com/watch?v=exyJ2CSfrHo
    '//       : Must be in abov format..just copy from address Bar
    '// By Ivan F Moala
    '// http://www.xcelfiles.com
    '// 18th Aug 2007
    '///////////////////////////////////////////////////////////////////////////////////////

    Dim strVideoUrl As String
    Dim strCode As String
    Dim objIE As Object
    Dim PosLastID As Long, PosVideoID As Long
    '// "Microsoft HTML Object Library"
    Dim HtmlDoc As New HTMLDocument
    Dim strYouTubeURL As String
 
    Set objIE = New InternetExplorer
    
        '// Paul Potts - change here as required
    strYouTubeURL = "http://www.youtube.com/watch?v=exyJ2CSfrHo"
        '// 720 Dunk
    'strYouTubeURL = "http://www.youtube.com/watch?v=9Xpcgthwdp0"
    
    '// Goto YouTube Site specified
    With objIE
        .navigate strYouTubeURL
            '// Remove IF you want it visible, you may hear the audio
        '.Visible = True
            '// Wait for the page to load
        Do While .Busy Or .readyState <> READYSTATE_COMPLETE
            DoEvents
        Loop
    End With
    
    '// Set Document object
    Set HtmlDoc = objIE.Document
    
    '// Set new IE Document into variable
    Set HtmlDoc = objIE.Document
        
    '// Extract HTML code from page whch contains OBJECT id = movie_player
    strCode = HtmlDoc.Body.innerHTML
    '// Find position of LastID
    PosLastID = InStr(1, strCode, "&sk=")
    '// Find position of VideoID
    PosVideoID = InStr(1, strCode, "amp;video_id")
    '// Get FileID
    strVideoUrl = Mid(strCode, PosVideoID + 13, PosLastID - PosVideoID - 13)
   
    '// Replace amp; as the 1st PARAM does NOT have Ctrl char and apend to URL_GET_VIDEO
    strVideoUrl = "http://youtube.com/get_video?video_id=" & Replace(strVideoUrl, "amp;", "", 1)
    
    '// Prompt user to Name with FLV extension
    MsgBox "The File Download Dialog box will appear shortly." & vbCrLf & _
        "When it prompts you to download, ensure you" & vbCrLf & _
        "name the file with an .flv extension.", vbInformation, "Name file convention"
        
    Dim Ret As Long
    '// Try downloading via Windows Download dialog
    Ret = DoFileDownload(StrConv(strVideoUrl, vbUnicode))
    
    '// Close site properly
    objIE.Quit
    Set objIE = Nothing
    Set HtmlDoc = Nothing

End Sub
 

Forum statistics

Threads
1,214,585
Messages
6,120,390
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top