There is no one cause for this error. Here are the steps to try:
1. If Legacy will not open because of run-time error 5, please delete from the Legacy folder on your hard drive all of the USR files (end with .usr). These files contain user settings to customized background colors, screen fonts, window sizes, startup family, report settings, as well as file locations, etc. There is no family data in any of these files, so deleting them does not delete your data. Upon start up, Legacy will recreate the files to their default settings.
2. Please update your Legacy program as this will often repair this error. Legacy 7.5 users please visit http://www.legacyfamilytree.com/DownloadUpdate.asp. Legacy 6.0 and earlier users please visit http://www.legacyfamilytree.com/helpDownloadVersion6.asp.