‘Run-time error 1004’
If you get the error “Run-time error ‘1004’: Programmatic access to Visual Basic Project is not trusted”, follow these steps (or equivalent steps in your version of Excel – the steps below are for Excel 10):
- Select File > Options.
- Select Trust Center > Trust Center Settings.
- Select Macro Settings.
- Check “Trust access to the VBA project object model”.
Postal Codes with Leading Zeroes
If you enter a postal code with a leading zero (e.g. 08540) Excel may interpret it as a number and remove the leading zero. To correct this problem, either type an apostrophe in front of the postal code (e.g. ‘08540) or format the field as text (“Text” category of the “Format Cells” command).
Converting Minutes to Hour:Minute Format
The DriveTime function returns the drive time between two points in minutes, but sometimes it is convenient to see the time in hour:minute format. To display drive times as “days hours:minutes” in Excel, you must first convert minutes to days by dividing by 24*60. For example:
‘The INI File Was Not Found’ Error
When loading the Add-In for the first time, this error may sometimes appear. Exit and re-enter Excel.
‘Sub or Function Not Defined’ Error
When making calls to PC*MILER Spreadsheets from a macro sheet, you may see this error message. To fix the problem, from the Tools menu select References and make sure that pcmsrv.xla is checked on.
This error occurs when the user enters a location (postal code or a city/state place name) that is not a valid PC*MILER location.
Problems Using Custom Routing From PC*MILER
If you have problems using custom routing that you created in PC*MILER, set the value of the following item in the PCMSERVE.INI file to TRUE. The PCMSERVE.INI file is located in your Windows or Winnt directory.
CustomRoute = TRUE
‘Error 1004: Programmatic Access to Visual Basic Project Is Not Trusted’
This error may occur when the user tries to open Excel after an older version of PC*MILER (Version 29 or older) has been uninstalled.
The problem occurs because the uninstall process deletes the “AccessVBOM” registry key on your computer. This registry key grants permission to use our Excel Add-ins. This issue was fixed in PC*MILER Version 30, but uninstalling older versions may still introduce this bug. If you are experiencing this problem, you can either:
- Modify your permissions in Excel using the following guideline to enable Trust Access to VBA Object Model (which is very easy to follow):
http://stackoverflow.com/questions/5300770/how-to-check-from-net-code-whether-trust-access-to-the-vba-project-object-mode ; or
- Reinstall PC*MILER (any version) so that the AccessVBOM registry key will be re-enabled.