I am having a wierd problem with Excel 2007. I have this spreadsheet that uses VBA forms to manipulate data entry and create reports. At first the program ran fine on my local pc. At then put it on sharepoint and for the most part it also ran fine. Now I copied a local version back to my desktop and I get the 57121 runtime error. It is strange because I know how to avoid it but I don't quite understand why.
When I first open the excel file and run the program I get the error when it tries to select a sheet in the vba code. When I click on debug I get this image in VBA Editor
\1
If you notice in the explorer view pane, the sheets are in blue and do not show the "name of the sheet". If I close the excel file, reopen it, go into the VBA editor before I execute the code that changes the sheet I get this in the explorer view pane:
\1
Which is normal. If i close out the vba editor and execute the code now, it runs fine. This happens each and every time I do this. I also tried the wait statement, but that did not work, any ideas?
Bookmarks