VBA EXPERTS: Refreshing a connection

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
821
Office Version
  1. 365
Platform
  1. Windows
I have a computer that is wireless I have a simple save macro below that I use. The problem I have is sometimes the network connection needs refreshed before the macro will work. Could some one help me modify the code below to do this. The network drive is "H:\Burney Table\Tester\Operators Form\Tester.xls"

Code:
Sub save()
    ActiveSheet.Unprotect
Dim cell As Range
    Application.EnableEvents = False
    For Each cell In Range("A4:E22")
        If Not cell.HasFormula Then
            cell.Value = UCase(cell.Value)
        End If
    Next cell
    
     Application.EnableEvents = True
    
     For Each cell In Range("G4:K22")
        If Not cell.HasFormula Then
            cell.Value = UCase(cell.Value)
        End If
    Next cell
    
    
    
    Range("h4").Select
    ActiveSheet.Protect
    ActiveWorkbook.Save
End Sub
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,215,268
Messages
6,123,966
Members
449,137
Latest member
yeti1016

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