Automate Excel with VBA Scripts Keep in mind that because this code will be run from Excel, you need to set a reference to Microsoft PowerPoint Object Library. You can set the reference by opening Visual Basic Editor in Excel and choosing Tool→References. Scroll down until you find the entry Microsoft PowerPoint xx Object Library, where the xx is your version of PowerPoint. Place a check in the check box next to the entry.