Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default One custom menu copies

I use this as part of a backup system each month:

Sub New_Month()
If MsgBox("Warning!! This Action Will Clear All Attendance!" & Chr(13) &
"Continue?", vbCritical + vbYesNo) = vbNo Then Exit Sub
Application.ScreenUpdating = False
Sheets(Array(5, 6)).Copy
Sheets(2).Range("Print_Area").Value = Sheets(2).Range("Print_Area").Value
ActiveWorkbook.SaveAs "FoodProduction" & Format(Range("g2"), "mmmyyyy") &
".xls"
ActiveWorkbook.Close

The weird thing is, one (of two) of the original workbook's custom menu
items copies to the new file, and then is duplicated on the original
workbook's menu bar when the copied sheets' file is closed. I already have
Workbook_Activate/Deactivate routines in place in the original file that I
thought would take care of that, but still the pesky menu item sticks.

What to do?

--
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default One custom menu copies

David wrote

I use this as part of a backup system each month:

Sub New_Month()
If MsgBox("Warning!! This Action Will Clear All Attendance!" & Chr(13)
& "Continue?", vbCritical + vbYesNo) = vbNo Then Exit Sub
Application.ScreenUpdating = False
Sheets(Array(5, 6)).Copy
Sheets(2).Range("Print_Area").Value =
Sheets(2).Range("Print_Area").Value ActiveWorkbook.SaveAs
"FoodProduction" & Format(Range("g2"), "mmmyyyy") & ".xls"
ActiveWorkbook.Close

The weird thing is, one (of two) of the original workbook's custom
menu items copies to the new file, and then is duplicated on the
original workbook's menu bar when the copied sheets' file is closed. I
already have Workbook_Activate/Deactivate routines in place in the
original file that I thought would take care of that, but still the
pesky menu item sticks.

What to do?


Ok, I stopped it by adding an Application.EnableEvents=False, but still
curious why only one menu item was copied to new workbook. Is it because
it's the one I was clicking to fire the routine?

--
David
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
How do you change the default number of copies in the print menu? TeeCee Excel Discussion (Misc queries) 3 March 28th 08 07:08 AM
printing custom copies pukka Excel Discussion (Misc queries) 0 November 2nd 05 09:53 PM
VBA - Disappearing custom menu and custom toolbar Peter[_50_] Excel Programming 2 December 2nd 04 06:09 PM
How to reference # of copies in print menu? Brandon Klassen Excel Programming 0 August 23rd 04 11:25 PM
Custom Menu return to Excel Menu upon Closing VetcalcReport Excel Programming 2 August 2nd 04 02:59 PM


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

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

About Us

"It's about Microsoft Excel"