My environment is Windows 7 64-bit running office 2010 32-bit. We developed an excel application using VBA forms in Excel 2003 and have converted to Excel 2010. Everything works fine, no errors, in excel 2007. In Excel 2010, it runs fine until we protect the VBA project. When protected and closed, then reopen the saved workbook it throws the error. on the developers computer it works the first time opened and then fails on the second and other times it fails on the first. We have done some research on it and found many posts making reference to using unqualified references to workbooks, sheets etc. in the code will produce the automation error. When we get the error after the first userform that has a drop down combobox that allows the user to select an input, then a second userform is populated based on the selection made in the first userform dropdown box. When the error happens the dialog box shows and it doesn't give the option to debug the code because the VBA project is protected. When the VBAproject is not protected we don't get the error so it has proven difficult to debug. The workbook has an autoOpen module that runs when the workbook starts. In this module it checks the users computer login to verifiy if the workbook can be opened by the user. So the order of events is AutoOpen which verifiys the user permisions, then the user opens first userform by clicking command button the main menu worksheet, selects the desired input, clicks enter (ok) and then it shows the second userform. It is clear to me that the issue is in the routine that populates the controls in the input form but only when the workbook is locked. If I unlock the workbook and run the tests again. everything runs. The reason that I’m concerned is because management does not want every user to beable to access the VBA code and I can’t push it out to users unless it is password protected. Does anyone have any ideas on how to fix this? I have been trying to fix this for the last 2 months and I can’t get past it. Any help or suggestions would be greatly appreciated.
We have tried many of the recommendations for this error. I don't believe this to be a code issue, as is still works just fine in Excel 2007. From what we have seen it appears to be a bug in Excel 2010. When we made the jump from office 2003 to 2010, the spread sheet worked as expected. So, it is our thoughts that is was caused by an update/patch to Office 2010. just not sure which KB update to uninstall.
For reference, this is happening on multiple computers running 64-bit windows 7 with the 32-bit version of Office 2010.