Normally, the following simple macro is functional on (SW2019):
Dim swApp As Object
Dim Part As ModelDoc2
Dim BoundingBox As Object
Dim longstatus As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set BoundingBox = Part.FeatureManager.InsertGlobalBoundingBox(swGlobalBoundingBoxFitOptions_e.swBoundingBoxType_BestFit, False, False, longstatus)
End Sub
Works with either a part or an assembly loaded in SW.