Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
my excel settings changed and i have only 1 instance running. Melissa Setting up and Configuration of Excel 1 March 28th 10 04:30 AM
Restoring Excel Fkeys settings to original values? Lautaro Excel Discussion (Misc queries) 0 June 24th 09 05:28 PM
restoring menu on excel 2003 MaGoO Excel Discussion (Misc queries) 1 May 26th 09 03:24 AM
Charts: Can the Default settings be changed jimbo Charts and Charting in Excel 1 July 24th 07 02:37 PM
Restoring the File option on the top Menu bar of Excel. Smitty50 Excel Discussion (Misc queries) 3 October 17th 06 04:45 PM


All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"