You can attach files. Click the Go Advanced button in lower right of a reply. Then click the Manage Attachments link below that box. From there, it is just browse and upload.

There are many tutorials that explain how to add a Module and add references.

1. https://www.tutorialspoint.com/vba/vba_quick_guide.htm
a. Ctrl+F and search for Module there.
b. Paste the code that I created for you in a new Module.
2. Ctrl+F in that same link and look for Reference.
a. Add the Microsoft Scripting Runtime reference as I commented.

I could make the reference late bound but you would not get the benefit of early binding. Early binding, most always lets intellisense work for that object. That makes learning the methods and properties easy. If it comes down to it, I can comment, uncomment the lines as I explained in the code comments. It is best to learn this simple thing though.
Use the UDF in as cell as I commented in the first line.

Lastly, you will likely need to pass the fullname with path to the function. Your last example did not have a path. If you want to use the path for the document with that macro, you can code the Function as such.