Macro Stopped working after yesterdays update.

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Macro Stopped working after yesterdays update.

  1. #1
    New Member
    Join Date
    Dec 2014
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Macro Stopped working after yesterdays update.

     
    First, thank you for looking at my post! I have a simple macro in a worksheet that I use every day for keeping track of working on projects. It has worked since I wrote it without trouble, until I did the Office 2010 updates yesterday. Now it does not run at all. There were several updates that ran yesterday for Office 2010, I don't know which one at this point caused the problem. Is there anyway to find out without just uninstalling one at a time?

    Any advice on what I should do? Change the macro, but I am not sure if I can get it back to working the way I would like. Below is the code. You can see there is not much too it. Just a quick macro to set the button to the correct state when it opens (bottom subroutine), and a macro to handle the toggle button click.

    Code:
    Public ActivateWS
    
    Private Sub ToggleButton1_Click()
    
        If ActivateWS = False Then
            If Me.ToggleButton1.Value = True Then
                Me.ToggleButton1.Caption = "Clock Out"
                Range("A7").Value = Date + Time
                Range("A7").NumberFormat = "mm/dd/yyyy hh:mm AM/PM"
            Else
                Me.ToggleButton1.Caption = "Clock In"
                Range("B7").Value = Date + Time
                Range("B7").NumberFormat = "mm/dd/yyyy hh:mm AM/PM"
                Range("C7").Formula = "=(B7-A7)*24"
                Range("C7").NumberFormat = "0.00"
                Rows("7:7").Insert Shift:=xlDown
                With Range("A7:D7")
                    .Interior.ColorIndex = xlNone
                    .RowHeight = 12.75
                    .Borders(xlEdgeLeft).LineStyle = xlContinuous
                    .Borders(xlEdgeTop).LineStyle = xlContinuous
                    .Borders(xlEdgeBottom).LineStyle = xlContinuous
                    .Borders(xlEdgeRight).LineStyle = xlNone
                    .Borders(xlInsideVertical).LineStyle = xlContinuous
                    .Borders(xlInsideHorizontal).LineStyle = xlContinuous
                End With
                Range("B3").Formula = "=(B2-B1)/24+A7"
                Range("D9").Copy    'Copy the previous sessions Notes.
                Range("D8").Select
                Paste
                Range("A7").Activate
            End If
        End If
        ActivateWS = False
    
    End Sub
    
    Private Sub Worksheet_Activate()
    
        ActivateWS = True
        If Range("A7").Value = "" Then
            Me.ToggleButton1.Value = False
            Me.ToggleButton1.Caption = "Clock In"
        Else
            Me.ToggleButton1.Value = True
            Me.ToggleButton1.Caption = "Clock Out"
        End If
    
    End Sub
    Thanks for any advice you can give.

  2. #2
    New Member GW WXLS's Avatar
    Join Date
    Dec 2014
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Macro Stopped working after yesterdays update.

    Have you checked the Trust settings in excel?
    File>Options>Trust Center>Trust Center Settings>Macro Settings

  3. #3
    New Member
    Join Date
    Dec 2014
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Macro Stopped working after yesterdays update.

    It is still set to "Enable all Macros".

    "Trust access to the VBA project object model" is checked (I don't know if that would apply though?).

  4. #4
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    41,474
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Macro Stopped working after yesterdays update.

    Is your button an ActiveX control?
    See: Office Update breaks ActiveX controls | Excel Matters
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  5. #5
    New Member
    Join Date
    Dec 2014
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Macro Stopped working after yesterdays update.

    Thank you! That fixed my problem!

  6. #6
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    41,474
    Post Thanks / Like
    Mentioned
    8 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Macro Stopped working after yesterdays update.

      
    Glad that it worked out for you.
    I have to defer credit to fellow member RoryA, for bringing that information to my attention yesterday.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com