This code itself is a VBA module. Open the Access database you wish to export. Open the MS Access in-built Visual Basic editor File->Import this module or create a new Module and paste in the code.