I am using Office 2000.
I have an Excel workbook with a custom menu (using the "CreateMenu" macro I found in: This has worked well for about a year, and survived one or two changes I made in the MenuSheet referred to in the above link, which resulted in the corresponding changes in the custom menu, and they worked. The custom menu opened up with the workbook, since I used the Workbook_Open subroutine in the ThisWorkbook code module, as recommended in the link.
A few days ago, I decided to make another change, which required the addition of a new macro. Since I didn't want to upset anything in the old spreadsheet, I saved it under a new name, and started working on that. I wrote the new macro, and added a sheet to which this would used to add new data. Everything seemed to work, and I then changed the Menusheet so that it would include the new macro. I tried it a couple of times, and it worked, adding the data properly to the new sheet.
I then used the revised custom menu, and new macro to add more data to rhe new sheet That worked as well, and I closed Excel, thinking everything was OK.
The next time I opened the new workbook, I got the Windows popup that says "Microsoft Excel for Windows has encountered a problem and needs to close. We are sorry for the inconvenience." So now I couldn't open up my new Workbook!
I then found that if I opened the old Workbook (with the old name) first, amd then the new workbook, everything (including the new custom menu and new macro) worked fine. If I then closed the old workbook, the Custom menu in the new workbook would disappear. If I then ran the CreateMenu macro manually, it came back again, and there was no problem using it. This leads me to believe that the problem is in the "Workbook_Open()" subroutine. But there is nothing there except a call to the CreateMenu macro, and is identical to the "Workbook_Open()" subroutine in the old workbook.
Can anyone give me any pointers on where to look to fix this problem? I would not call myself a very experienced VBA Excel programmer. As a matter of fact, the old workbook was the first time I had written VBA macros, but in the end, they worked, and reliably for almost a year.
I have an Excel workbook with a custom menu (using the "CreateMenu" macro I found in: This has worked well for about a year, and survived one or two changes I made in the MenuSheet referred to in the above link, which resulted in the corresponding changes in the custom menu, and they worked. The custom menu opened up with the workbook, since I used the Workbook_Open subroutine in the ThisWorkbook code module, as recommended in the link.
A few days ago, I decided to make another change, which required the addition of a new macro. Since I didn't want to upset anything in the old spreadsheet, I saved it under a new name, and started working on that. I wrote the new macro, and added a sheet to which this would used to add new data. Everything seemed to work, and I then changed the Menusheet so that it would include the new macro. I tried it a couple of times, and it worked, adding the data properly to the new sheet.
I then used the revised custom menu, and new macro to add more data to rhe new sheet That worked as well, and I closed Excel, thinking everything was OK.
The next time I opened the new workbook, I got the Windows popup that says "Microsoft Excel for Windows has encountered a problem and needs to close. We are sorry for the inconvenience." So now I couldn't open up my new Workbook!
I then found that if I opened the old Workbook (with the old name) first, amd then the new workbook, everything (including the new custom menu and new macro) worked fine. If I then closed the old workbook, the Custom menu in the new workbook would disappear. If I then ran the CreateMenu macro manually, it came back again, and there was no problem using it. This leads me to believe that the problem is in the "Workbook_Open()" subroutine. But there is nothing there except a call to the CreateMenu macro, and is identical to the "Workbook_Open()" subroutine in the old workbook.
Can anyone give me any pointers on where to look to fix this problem? I would not call myself a very experienced VBA Excel programmer. As a matter of fact, the old workbook was the first time I had written VBA macros, but in the end, they worked, and reliably for almost a year.