Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restoring Excel menu bar settings that were changed by code
Howard -
I wonder if that workbook not only had code to create the customized menus, but also has customized menus attached to it. Tools menu Customize Attach button. - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Howard Kaikow wrote: I've been playing with a workbook that includes code that saves and restores the user's Excel environment, e.g., by hiding toolbars and particular items in the Excel menu, then restoring the environment when the macro completes. That's fine, I've done the same thing myself. For my purposes, I've removed that code and tried to use Tools |Customize to reset the workbook menu back to Excel's defaults. However, if I save, close and re-open the workbook, I find that the settings do not stick and revert to the customized settings that had been created by the macro code. Why aren't the settings sticking when I reset the menus? The workbook was originally created with Excel 97, and I am using Excel 2002, could that be the problem? I guess that I could write workbook_open code to remedy the situation, but that should not be necessary, should it? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restoring Excel menu bar settings that were changed by code
Only code Attached is PDFMaker and Textbridge (for the scanner).
I yelled Uncle! And just created a new workbook to which I copied the code and worksheet. I am going to ASSuME that the problem was due either to a corrupt workbook, or a problem in migrating the original workbook from Excel 97 to Excel 2002. Dag nab it! I keep forgetting to test the critter directly in Excel 97. I'll try that and post the outcome here. -- http://www.standards.com/; Howard Kaikow's web site. ------------------------------------------------ "Jon Peltier" wrote in message ... Howard - I wonder if that workbook not only had code to create the customized menus, but also has customized menus attached to it. Tools menu Customize Attach button. - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Howard Kaikow wrote: I've been playing with a workbook that includes code that saves and restores the user's Excel environment, e.g., by hiding toolbars and particular items in the Excel menu, then restoring the environment when the macro completes. That's fine, I've done the same thing myself. For my purposes, I've removed that code and tried to use Tools |Customize to reset the workbook menu back to Excel's defaults. However, if I save, close and re-open the workbook, I find that the settings do not stick and revert to the customized settings that had been created by the macro code. Why aren't the settings sticking when I reset the menus? The workbook was originally created with Excel 97, and I am using Excel 2002, could that be the problem? I guess that I could write workbook_open code to remedy the situation, but that should not be necessary, should it? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restoring Excel menu bar settings that were changed by code
Here's what I've done. It might enable others to reproduce the problem.
I started by using the chap09.xls workbook from the MSPress Microsoft Excel 97 Developer's Handbook. That workbook has a useful example of how to use Scenarios via VBA, a topic I'm finding is not widely documented in the Excel VBA books. In that example, the authors go one step further and modify the default menu bar by eliminating many menu items and adding a menu. To do this, they include code to save and restore the environment and code to create the menu, all pretty straightforward. I eventually ended up creating my own TestScenarios.xls with my own code, but to eliminate the menu problem I had to do this in a new workbook. In order to better describe the problem, without using my own code, I just did the following. I am guessing that anybody having the book should be able to reproduce the problem. 1. Made a copy of chap09.xls. 2. Went into code and commented out all code I thought was relevant. For example, there is a Sub SetEnvironment in which I commented out ALL lines between the Sub and End Sub statements. 3. I then went to the workbook and used Tools | Customize to delete the added Edit App menu, then Reset the Menu Bar. 4. I then saved the workbook under a new name. My expectations were that since I had deleted the Menu item, Reset the Menu bar and commented out ALL relevant code, the default menu bar should appear when I next open the workbook. Well, to my chagrin (and I'm not grinning!), not only did the custom menu bar reappear, it included the custom menu. I do not understand how this could happen after I've commented out the code. Did Excel 97 store internal copies of the menu that are reset automatically? Any ideas? Since the workbook is distributed with the MSPress book, I cannot make the workbook available to others. -- http://www.standards.com/; Howard Kaikow's web site. ------------------------------------------------ "Jon Peltier" wrote in message ... Howard - I wonder if that workbook not only had code to create the customized menus, but also has customized menus attached to it. Tools menu Customize Attach button. - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Howard Kaikow wrote: I've been playing with a workbook that includes code that saves and restores the user's Excel environment, e.g., by hiding toolbars and particular items in the Excel menu, then restoring the environment when the macro completes. That's fine, I've done the same thing myself. For my purposes, I've removed that code and tried to use Tools |Customize to reset the workbook menu back to Excel's defaults. However, if I save, close and re-open the workbook, I find that the settings do not stick and revert to the customized settings that had been created by the macro code. Why aren't the settings sticking when I reset the menus? The workbook was originally created with Excel 97, and I am using Excel 2002, could that be the problem? I guess that I could write workbook_open code to remedy the situation, but that should not be necessary, should it? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restoring Excel menu bar settings that were changed by code
I did get the point.
Instead of "Only code Attached is PDFMaker and Textbridge (for the scanner)." I meant to say: "Only Custom Toolbars Attached are PDFMaker and Textbridge (for the scanner)." -- http://www.standards.com/; Howard Kaikow's web site. ------------------------------------------------ "Jon Peltier" wrote in message ... Howard - I'm not sure if you got my point about attached command bars. A workbook can have custom command bars attached to it, so they always appear when the file opens. Copying the file and renaming it would keep the attached command bars intact. - Jon ------- Jon Peltier, Microsoft Excel MVP http://www.geocities.com/jonpeltier/Excel/index.html _______ Howard Kaikow wrote: Here's what I've done. It might enable others to reproduce the problem. I started by using the chap09.xls workbook from the MSPress Microsoft Excel 97 Developer's Handbook. That workbook has a useful example of how to use Scenarios via VBA, a topic I'm finding is not widely documented in the Excel VBA books. In that example, the authors go one step further and modify the default menu bar by eliminating many menu items and adding a menu. To do this, they include code to save and restore the environment and code to create the menu, all pretty straightforward. I eventually ended up creating my own TestScenarios.xls with my own code, but to eliminate the menu problem I had to do this in a new workbook. In order to better describe the problem, without using my own code, I just did the following. I am guessing that anybody having the book should be able to reproduce the problem. 1. Made a copy of chap09.xls. 2. Went into code and commented out all code I thought was relevant. For example, there is a Sub SetEnvironment in which I commented out ALL lines between the Sub and End Sub statements. 3. I then went to the workbook and used Tools | Customize to delete the added Edit App menu, then Reset the Menu Bar. 4. I then saved the workbook under a new name. My expectations were that since I had deleted the Menu item, Reset the Menu bar and commented out ALL relevant code, the default menu bar should appear when I next open the workbook. Well, to my chagrin (and I'm not grinning!), not only did the custom menu bar reappear, it included the custom menu. I do not understand how this could happen after I've commented out the code. Did Excel 97 store internal copies of the menu that are reset automatically? Any ideas? Since the workbook is distributed with the MSPress book, I cannot make the workbook available to others. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restoring Excel menu bar settings that were changed by code
OK, that's the line that threw me off. So I guess I don't know what's
going on. - Jon Howard Kaikow wrote: I did get the point. Instead of "Only code Attached is PDFMaker and Textbridge (for the scanner)." I meant to say: "Only Custom Toolbars Attached are PDFMaker and Textbridge (for the scanner)." |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Restoring Excel menu bar settings that were changed by code
I guess the next step is for me to read the details explaining the code in
the accompanying book. I read that stuff quickly, but I was just looking for the stuff on Scenarios, could be there's more specifics on this issue. -- http://www.standards.com/; Howard Kaikow's web site. ------------------------------------------------ "Jon Peltier" wrote in message ... OK, that's the line that threw me off. So I guess I don't know what's going on. - Jon Howard Kaikow wrote: I did get the point. Instead of "Only code Attached is PDFMaker and Textbridge (for the scanner)." I meant to say: "Only Custom Toolbars Attached are PDFMaker and Textbridge (for the scanner)." |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
my excel settings changed and i have only 1 instance running. | Setting up and Configuration of Excel | |||
Restoring Excel Fkeys settings to original values? | Excel Discussion (Misc queries) | |||
restoring menu on excel 2003 | Excel Discussion (Misc queries) | |||
Charts: Can the Default settings be changed | Charts and Charting in Excel | |||
Restoring the File option on the top Menu bar of Excel. | Excel Discussion (Misc queries) |