Macro Stopped working after yesterdays update.

___AW

New Member
Joined
Dec 11, 2014
Messages
5
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.
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

GW WXLS

New Member
Joined
Dec 5, 2014
Messages
20
Have you checked the Trust settings in excel?
File>Options>Trust Center>Trust Center Settings>Macro Settings
 

___AW

New Member
Joined
Dec 11, 2014
Messages
5
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?).
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
52,949
Office Version
365
Platform
Windows
Glad that it worked out for you.
I have to defer credit to fellow member RoryA, for bringing that information to my attention yesterday.
 

Watch MrExcel Video

Forum statistics

Threads
1,095,146
Messages
5,442,645
Members
405,191
Latest member
wedloski

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top