+ Reply to Thread
Results 1 to 2 of 2

One custom menu copies

  1. #1
    David
    Guest

    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. #2
    David
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1