MediaInfo and VBA Macro

Help
2014-02-03
2014-02-06
  • I have been writing a macro in Excel VBA that uses the XML output from MediaInfo, however I would like to integrate MediaInfo directly in the macro. Can anyone provide me guidance on how can I extract the metadata / tags from FLAC files from a directory in VBA? I have been looking up various solutions for a few days now and can't seem to understand what would work best. I presume it involves calling the MediaInfo.dll..?

    My typical workflow is very basic -- I first select the CD Drive to examine (D:), then the program runs (as there can be as many as 900 FLAC files on a CD/DVD), then I export the XML to my desktop. Instead of exporting the XML, I would like to return the tags across columns.

    Any help or guidance would be of enormous help.

    Note:
    I am aware of Exceltagger (http://theoligarch.com/exceltagger.htm), which is almost what I need, however the tags in my FLAC files are not the standard "Artist", "Album", etc. My .flac files are of phone numbers so the tags include "Number Dialed", "Date of Call", "Time of Call", etc. The author of Exceltagger noted that he was not going to support additional tags because that involved going back into the C++ source code.

     
  • I added a Excel VBA example, I tested it several years ago and it was working well, I did not test this year but it should still work.
    There is no support about it,but it can be a good base for your own development.

     
  • Thanks, Jerome. I had not seen that example you posted, which will be of great help.

    I do have an initial error when I click on the Button -- "Error in loading DLL". I have installed the DLL from http://mediaarea.net/us/MediaInfo/Download/Windows for my 64 bit computer. I have checked that C:\Windows\SysWOW64\MediaInfo.dll exists. Any initial reactions to why the macro does not work?

     
  • Umar Hayat
    Umar Hayat
    2014-02-04

    Hello Benjamin,

    I am using this Macro but it has error on LongPtr. I am using Excel 2007 32bit what i do in this situation.

    Best Regards

     
  • I had not seen that example you posted

    Normal, I just added it ;-)

    "Error in loading DLL"

    I am using this Macro but it has error on LongPtr

    I updated the example with 64-bit support now, it should be OK with 32 and 64-bit.
    I tested copying 64-bit DLL (from the 7z package directly) in C:\Windows, and I can run it With Excel 2010 64-bit.
    I don't plan to do more for it (at least with free support), so you are now on your own...

     
  • Thanks for your help, Jerome. I still have the "Error in loading DLL" when I click on the button.

    MediaInfo.dll exists here: C:\Windows\MediaInfo.dll (4.09 MB), which was copied directly from MediaInfo_DLL_0.7.67_Windows_x64_WithoutInstaller.7z

    Is there anything else I need to do? Do I need to register MediaInfo.dll? Do I need to download/register MediaInfoActiveX.dll?

    I am also running Excel 2010 64-bit. I am willing to compensate you for additional support.

     
    Attachments
  • Is there anything else I need to do? Do I need to register MediaInfo.dll?

    No, nothing to do. I just run the example I have put on the source repository and all is OK. You need to dig in the code and see where it is buggy.

    I am willing to compensate you for additional support.

    Please contact me directly at info@mediaarea.net for professional services.

     
  • The VBA Example posted by Jerome functions properly. The error was a silly one on my end -- double check that even if you are running a 64-bit machine, your Excel may be 32-bit!!

    Cheers, Ben.