I found this code from spreadsheetguru. The purpose of the code is to activate the Excel 16.0 Library. I want to be able to add this before my code so that it automatically adds the Library and then runs the rest of the code that requires it. Right now I have it in two subs. One is the Private Sub that I have here, and the next is a Public Sub with the rest of my macro. Right now when I run the macro it runs the code psoted here, and then stops. Then If I click again it will run the next sub. Is there any way for me to make this all just go in one click? Maybe by making it all one sub, or some other Private/Public Sub combination I'm not aware of?
Thanks!
Private Sub ActivateReferenceLibrary()
'PURPOSE: Activate Specific Object Libraries
'Error Handler in Case Reference is Already Activated
On Error Resume Next
'Activate PowerPoint Library (version 2.9)
Application.VBE.ActiveVBProject.References.AddFromGuid _
GUID:="{00020813-0000-0000-C000-000000000046}", _
Major:=0, Minor:=0
'Reset Error Handler
On Error GoTo 0
End Sub