Well may be this VB code be a help
Application.CompactRepair SourceFile, DestinationFile [, LogFile]
'SourceFile = File to be compacted/repaired
'DestinationFile = the new compacted/repaired file
'LogFile = Optional (boolean) whether a log file should be created
Source:- recoveryandmanagement.wordpress.com/.../