ActiveWorkbook.Save macro causing no edit capability

jackirby

New Member
Joined
Oct 4, 2007
Messages
3
Hello,

I have an Excel workbook with 3 worksheets, running Excel 2016, where upon start-up I run a macro (in ThisWorkbook) to hide the ribbon and formula bar.

Private Sub Workbook_Activate()
Dim ws As Worksheet
Application.ScreenUpdating = False
Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
Application.DisplayFormulaBar = False
ActiveWindow.DisplayHeadings = False
...
End Sub

On worksheet 1 I have a button that calls:

Private Sub CommandButton6_Click()
ActiveWorkbook.Save
End Sub

This command successfully saves the file, however, I am then unable to edit any cell in the worksheet.... until I switch to another worksheet (either 2 or 3) and then come back to worksheet 1. Once I change the focus away from worksheet 1 and then back to worksheet 1, editing is then available.

Any ideas of what may be causing this behavior?

Thanks.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Welcome to the board.

Turn screen updating back on before leaving the macro.
 
Upvote 0
SHG,

Thank you for your prompt reply. When I pasted my start-up code in my original post I didn't include all of it.

Here is the complete macro:
Code:
Private Sub Workbook_Activate()
    Dim ws As Worksheet
    Application.ScreenUpdating = False
    Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
    Application.DisplayFormulaBar = False
    ActiveWindow.DisplayHeadings = False
    Application.AutoRecover.Time = 5
    '*******
    'Let's keep the Status Bar so the user can easily change the magnification of the worksheet
    '*******
    'Application.DisplayStatusBar = Not Application.DisplayStatusBar
    'ActiveWindow.DisplayWorkbookTabs = False
    With Application.ErrorCheckingOptions
        .NumberAsText = False
        .InconsistentTableFormula = False
        '
        .EvaluateToError = False
        .TextDate = False
        .InconsistentFormula = False
        .OmittedCells = False
        .UnlockedFormulaCells = False
    End With
    For Each ws In ThisWorkbook.Worksheets
        If Left(ws.Name, 7) = "Hidden_" Then
            ws.Visible = xlSheetHidden
        End If
    Next ws
    Application.ScreenUpdating = True

End Sub

As you can see, I did turn screen updating back on at the end.

My problem is with the Save command.
Code:
Private Sub CommandButton6_Click()
    ActiveWorkbook.Save
End Sub

When this is called it prevents any further updating of the worksheet.

Interestingly enough, Ctrl-S works just fine. Saves the document and still enables editing.

Thanks again for your response. Any other ideas?

-Jack
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,838
Members
449,471
Latest member
lachbee

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