Private Sub Workbook_Activate()
If ActiveWorkbook.Name = "AlarmLog.xls" Then
expression.RunAutoMacros (Alarms_barChart)
End If
End Sub
Sub Alarms_barChart()
' Alarms_barChart Macro
' only use with DBF file
' Sneltoets: Ctrl+ J
'**** Create folder if not ****
Dim Map
Dim fol As String
fol = "D:\Colpitt machine data" ' change to match the folder path
Set Map = CreateObject("Scripting.FileSystemObject")
If Not Map.FolderExists(fol) Then
Map.CreateFolder (fol)
End If
Range("K2").Select
Range("K2,K:K").FormulaR1C1 = "=IF(RC[-3]-RC[-4]<=0,,RC[-3]-RC[-4])"
Range("K:K").NumberFormat = "h:mm:ss;@"
.......
...
....
......
End Sub