bamaisgreat
Well-known Member
- Joined
- Jan 23, 2012
- Messages
- 826
- Office Version
- 365
- Platform
- Windows
I am looking for some code to add to the beginning of the code below to check for a network connection before continuing.... Thanks
Sub Job_Send()
If MsgBox("By pressing Yes you confirm that all information entered is correct.", _
vbCritical + vbYesNo, "") = vbNo Then Exit Sub
ActiveSheet.Unprotect
Dim ButtonName As Variant
Dim ButtonNames As Variant
ButtonNames = Array("Button 4", "Button 5", "Button 6")
For Each ButtonName In ButtonNames
ActiveSheet.Buttons(ButtonName).Visible = False
Next ButtonName
Range("h24").Select
Selection.Interior.ColorIndex = 6
ActiveCell.FormulaR1C1 = "OPERATOR CHECKED"
With ActiveCell.Characters(Start:=1, Length:=14).Font
.name = "Arial"
.FontStyle = "Bold"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Range("A4:e22").Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("g4:n22").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("p422").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("r4:t22").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("H20").Select
ActiveWorkbook.Save
ActiveWindow.SmallScroll Down:=-6
Range("I4").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Save
ActiveWorkbook.SaveAs Filename:="H:\Burney Table\CUTTING FORMS (Protected by QC)\" & _
Format(Now(), "mm-dd-yyyy hh-mm-ss") & " BURNEY 1 JOB FORM", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
Range("I4").Select
ButtonNames = Array("Button 8")
For Each ButtonName In ButtonNames
ActiveSheet.Buttons(ButtonName).Visible = False
Next ButtonName
ActiveWorkbook.Save
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"H:\Burney Table\Cutting Forms PDF\" & Format(Now(), "mm-dd-yyyy hh-mm-ss") & " BURNEY 1 JOB.pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
ActiveWorkbook.Save
ActiveSheet.Unprotect
With Range("$H$1:$K$1")
.Locked = False
.FormulaHidden = False
End With
ActiveSheet.Protect Password:="1288", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Save
Workbooks.Open ("H:\Burney Table\BURNEY 1\operators form\BURNEY 1.xls")
Windows("BURNEY 1.xls").Activate
ActiveWorkbook.Save
ThisWorkbook.Close SaveChanges = True
Application.Quit
End Sub
Sub Job_Send()
If MsgBox("By pressing Yes you confirm that all information entered is correct.", _
vbCritical + vbYesNo, "") = vbNo Then Exit Sub
ActiveSheet.Unprotect
Dim ButtonName As Variant
Dim ButtonNames As Variant
ButtonNames = Array("Button 4", "Button 5", "Button 6")
For Each ButtonName In ButtonNames
ActiveSheet.Buttons(ButtonName).Visible = False
Next ButtonName
Range("h24").Select
Selection.Interior.ColorIndex = 6
ActiveCell.FormulaR1C1 = "OPERATOR CHECKED"
With ActiveCell.Characters(Start:=1, Length:=14).Font
.name = "Arial"
.FontStyle = "Bold"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Range("A4:e22").Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("g4:n22").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("p422").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("r4:t22").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Range("H20").Select
ActiveWorkbook.Save
ActiveWindow.SmallScroll Down:=-6
Range("I4").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Save
ActiveWorkbook.SaveAs Filename:="H:\Burney Table\CUTTING FORMS (Protected by QC)\" & _
Format(Now(), "mm-dd-yyyy hh-mm-ss") & " BURNEY 1 JOB FORM", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
Range("I4").Select
ButtonNames = Array("Button 8")
For Each ButtonName In ButtonNames
ActiveSheet.Buttons(ButtonName).Visible = False
Next ButtonName
ActiveWorkbook.Save
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"H:\Burney Table\Cutting Forms PDF\" & Format(Now(), "mm-dd-yyyy hh-mm-ss") & " BURNEY 1 JOB.pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
ActiveWorkbook.Save
ActiveSheet.Unprotect
With Range("$H$1:$K$1")
.Locked = False
.FormulaHidden = False
End With
ActiveSheet.Protect Password:="1288", DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWorkbook.Save
Workbooks.Open ("H:\Burney Table\BURNEY 1\operators form\BURNEY 1.xls")
Windows("BURNEY 1.xls").Activate
ActiveWorkbook.Save
ThisWorkbook.Close SaveChanges = True
Application.Quit
End Sub