Using VLC player activex within excel vba as a registration-free COM
<p>Problem definition</p>

<p>I have two usb microscope reading part and serial numbers.
I want to control the display and recording of screen shots from Excel-VBA.</p>

<p>I would like to try this using the supplied VLC active X component.
I need the finish product to be a single zip that does not need to be installed.
I think using this activex object as a registration-free COM is the way to go.</p>

<p>References</p>

<p>I have been doing my homework, here are my references.</p>

<p><a href="https://stackoverflow.com/questions/36280623/how-to-use-vlc-dll-without-registration">How to use vlc.dll without registration?</a></p>

<p><a href="https://msdn.microsoft.com/en-us/library/fh1h056h.aspx" rel="noreferrer">Registration-Free COM Interop</a></p>

<p><a href="https://social.msdn.microsoft.com/Forums/en-US/baec16d1-e85c-4be9-8751-966bef527756/vlc-player-and-excel-visual-basic-editor?forum=isvvba" rel="noreferrer">VLC Player and Excel Visual Basic Editor</a></p>

<p><a href="https://stackoverflow.com/questions/15503117/cannot-get-registration-free-com-working-from-vba">Cannot get registration-free COM working from VBA</a></p>

<p>My attempt so far.</p>

<p>I created
Desktop\excel vlc demo\excel vlc demo.xlsb
I then copied the entire vlc distribution to Desktop\excel vlc demo\vlc\</p>

<p>This includes axvlc.dll and <a href="https://pastebin.mozilla.org/8907053" rel="noreferrer">axvlc.dll.manifest</a></p>

<p>I created a module and put this code in.</p>

<pre><code>Sub VLC()
    Dim actCtx As Object
    Set actCtx = CreateObject("Microsoft.Windows.ActCtx")
    actCtx.Manifest = ThisWorkbook.Path &amp; "\vlc\axvlc.dll.manifest"

    Dim myVlC As Object
    Set myVlC = actCtx.CreateObject("AXVLC.VLCPlugin2")

    myVlC.Visible = True
    myVlC.playlist.Add (ThisWorkbook.Path &amp; "\demo.mov")
    myVlC.playlist.Play

End Sub
</code></pre>

<p>This fails at the line</p>

<pre><code>    Set myVlC = actCtx.CreateObject("AXVLC.VLCPlugin2")
</code></pre>

<p>with error </p>

<pre><code>    Run-time error '429':
    ActiveX component can't create object
</code></pre>

<p>It is possible I have the wrong object name "AXVLC.VLCPlugin2", I could not confirm if it is still valid in the <a href="https://wiki.videolan.org/Documentation:WebPlugin/" rel="noreferrer">documentation</a>.</p>

<p>It could also be that "user1610015" is correct in saying that "I don't think you can make reg-free COM work in this case"</p>

<p>At this point I am out of ideas, I never tried reg-free COM before so I don't know if I'm doing something wrong with the reg-free COM or the axvlc part !</p>

<p>thanks </p>

<p>EDIT 1: Attempt with early binding</p>

<p>I went in tool -> references, then clicked browse and added the axvlc.dll file.
I modified the code as follows (the AXVLC.VLCPlugin2
 part auto-completed so at least this part should work)</p>

<pre><code>Sub VLC()
    Dim myVlC As New AXVLC.VLCPlugin2
    myVlC.Visible = True
    myVlC.playlist.Add (ThisWorkbook.Path &amp; "\demo.mov")
    myVlC.playlist.Play

End Sub
</code></pre>

<p>However this fails with the same error </p>

<pre><code>    Run-time error '429':
    ActiveX component can't create object
</code></pre>

<p>on the line </p>

<pre><code>myVlC.Visible = True
</code></pre>

<p>Perhaps I also need to register this file with regsrv32 ?
EDIT 2:  tried regsvr32 </p>

<p>ran this command from the vlc subfolder</p>

<pre><code>regsvr32 axvlc.dll
</code></pre>

<p>I got a msgbox saying this command ran successfully, however I get the same error.</p>