I am trying to add external libraries and use them in VBA for Excel. I have found two questions about it, but I can't get them to work in a real application.
Both of them work fine on their own, but when I try to use them in a program I get a compiler error. It seems that I cannot compile the program before I add the library (makes sense, I use unknown objects) and I cannot add the references before I compile the program.
How can I solve this?
Question 1:
Connect references (Tools>References) with VBA code (macros)
Question 2:
How to add a reference programmatically