The macro and the building block should reside in the same template file. This reduces complexity when you need to distribute both to other users.
The code that is pointing at ActiveDocument.AttachedTemplate assumes you actually placed the building block in that template. The acceptable values for BuildingBlockTypes are shown on this page
WdBuildingBlockTypes enumeration (Word) | Microsoft Docs
So if you saved the building block in the attached template as an AutoText, with a category of General and a name of Table then the following line should work
Code:
ActiveDocument.AttachedTemplate.BuildingBlockTypes(wdTypeAutoText).Categories("General").BuildingBlocks("Table").Insert Where:=Selection.Range, RichText:=True
If that was all you were putting in the macro, you could just type the word Table and then press F3 to insert the same