Advertisement

01.24.2008 at 10:08AM PST, ID: 23108536
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

I need a way to halt an Excel Procedure "Private Sub Workbook_Open()" to use as needed

Asked by Mswetsky in Microsoft Excel Spreadsheet Software

Tags: ,

I have a workbook that is scheduled to run using MS Scheduled tasks. The code is inside this Workbook open and the file has digital signatures so no pop ups come up.
My problem is when I want to make a change and don't want any code exectued at start.
I thought I could hold the shift key down to disable the macro but it runs one loop and sends mail before stopping.

Is there something I am missing or another way to look at this?
There is a snip of code below as an example. I actually mail 28 files with the code and only included a short sample.

Private Sub Workbook_Open()
'This procedure Below will mail copies of the specific books.
    Dim wb As Workbook
    Dim TempFilePath As String
    Dim TempFileName As String
    Dim FileExtStr As String
    Dim iMsg As Object
    Dim iConf As Object
    '    Dim Flds As Variant

'MAIL # 1++++++++++++++++++++++++++++++++++++++++++++++++++++
    ChDir "Q:\MIS\Aspect\Daily"
    Workbooks.Open Filename:="Q:\MIS\AspectIV\CCSC 452 - Current Customer.xls"

    Set wb = ActiveWorkbook
    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With

  'Make a copy of the file/Mail it/Delete it
    TempFilePath = Environ$("temp") & "\"
    TempFileName = wb.Name & " " & Format(Now - 1, "dd-mmm-yy")
    FileExtStr = "." & LCase(Right(wb.Name, Len(wb.Name) - InStrRev(wb.Name, ".", , 1)))
    wb.SaveCopyAs TempFilePath & TempFileName & FileExtStr

    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    With iMsg
        Set .Configuration = iConf
        .To = "Hele.com"
        .CC = ""
        .BCC = "mitch.com"
        .From = "MrDa.com"
        .Subject = "This is an automated mailing of report ccsc_452.xls"
        .TextBody = "comments, Please Email Mitch."
        .AddAttachment TempFilePath & TempFileName & FileExtStr
        .Send
    End With
         Kill TempFilePath & TempFileName & FileExtStr

    With Application
        .ScreenUpdating = True
        .EnableEvents = True
    End With
ActiveWorkbook.Save
ActiveWindow.Close

'MAIL # 2++++++++++++++++++++++++++++++++++++++++++++++++++++
    ChDir "Q:\MIS\Aspect\Daily"
    Workbooks.Open Filename:="Q:\MIS\AspectIV\CCSC 454 - Current.xls"
   Set wb = ActiveWorkbook
    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With

  'Make a copy of the file/Mail it/Delete it
    TempFilePath = Environ$("temp") & "\"
    TempFileName = wb.Name & " " & Format(Now - 1, "dd-mmm-yy")
    FileExtStr = "." & LCase(Right(wb.Name, Len(wb.Name) - InStrRev(wb.Name, ".", , 1)))
    wb.SaveCopyAs TempFilePath & TempFileName & FileExtStr

    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    With iMsg
        Set .Configuration = iConf
        .To = "helre.com"
        .CC = ""
        .BCC = "mitccom"
        .From = "MrDacom"
        .Subject = "This is an automated mailing of Aspect report ccsc_454.xls"
        .TextBody = " comments, Please Email Mitch."
        .AddAttachment TempFilePath & TempFileName & FileExtStr
        .Send
    End With

   Kill TempFilePath & TempFileName & FileExtStr

    With Application
        .ScreenUpdating = True
        .EnableEvents = True
    End With
ActiveWorkbook.Save
ActiveWindow.Close
 End Sub()Start Free Trial
[+][-]01.24.2008 at 10:19AM PST, ID: 20735706

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.24.2008 at 10:25AM PST, ID: 20735771

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.24.2008 at 10:39AM PST, ID: 20735892

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.24.2008 at 10:41AM PST, ID: 20735909

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.24.2008 at 10:46AM PST, ID: 20735964

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.24.2008 at 03:31PM PST, ID: 20738707

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.25.2008 at 05:47AM PST, ID: 20742360

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.25.2008 at 06:19AM PST, ID: 20742655

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Excel Spreadsheet Software
Tags: Excel, 2000
Sign Up Now!
Solution Provided By: byundt
Participating Experts: 3
Solution Grade: A
 
 
[+][-]01.25.2008 at 07:29AM PST, ID: 20743223

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628