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.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Have you checked the Trust settings in excel?
File>Options>Trust Center>Trust Center Settings>Macro Settings
 
Upvote 0
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?).
 
Upvote 0
Glad that it worked out for you.
I have to defer credit to fellow member RoryA, for bringing that information to my attention yesterday.
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,995
Members
448,539
Latest member
alex78

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top