I built this in 2007, but found out after the fact that my company's servers only run 2003.
The servers won't process this because of an error, but it works in 2007. Can someone look at it and tell me if they see anything that might not be compatible? Thanks!
The servers won't process this because of an error, but it works in 2007. Can someone look at it and tell me if they see anything that might not be compatible? Thanks!
Code:
Sub Auto_Open()
'
' Macro3 Macro
'
'
Workbooks.Open Filename:="D:\pbs\temp\q1.xls"
'*** BASED ON QUERY 818 ****
Range("B1").Select
Sheets.Add After:=Sheets(Sheets.Count)
Sheets("Query NO 818").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$AX$600").AutoFilter Field:=2, Criteria1:= _
xlFilterToday, Operator:=xlFilterDynamic
Cells.Select
Selection.Copy
Sheets("Sheet1").Select
ActiveSheet.Paste
Range("F12").Select
Range("C2").Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("C2"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A2:AX11")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("D2:D11").Select
Selection.Copy
Range("D17").Select
ActiveSheet.Paste
Range("F2:F11").Select
Application.CutCopyMode = False
Selection.Copy
Range("F17").Select
ActiveSheet.Paste
Range("H2:H11").Select
Application.CutCopyMode = False
Selection.Copy
Range("H17").Select
ActiveSheet.Paste
Range("C17:C26").Select
Application.CutCopyMode = False
Selection.NumberFormat = "h:mm"
Range("C17").Select
ActiveCell.FormulaR1C1 = "1/6/1900 12:00:00 AM"
Range("C17").Select
ActiveCell.FormulaR1C1 = "6:00"
Range("C18").Select
ActiveCell.FormulaR1C1 = "8:00"
Range("C18").Select
Selection.AutoFill Destination:=Range("C18:C19"), Type:=xlFillDefault
Range("C18:C19").Select
Selection.AutoFill Destination:=Range("C18:C25"), Type:=xlFillDefault
Range("C18:C25").Select
Selection.AutoFill Destination:=Range("C18:C26"), Type:=xlFillDefault
Range("C18:C26").Select
Selection.AutoFill Destination:=Range("C18:C27"), Type:=xlFillDefault
Range("C18:C27").Select
Range("C27").Select
ActiveCell.FormulaR1C1 = "6:00:00 PM"
Range("C28").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Range("'Sheet1'!$C$17:$D$27")
ActiveChart.ChartType = xlLineMarkers
ActiveChart.Legend.Select
Selection.Delete
ActiveChart.ClearToMatchStyle
ActiveChart.ChartStyle = 41
ActiveChart.ClearToMatchStyle
Range("A17").Select
ActiveCell.FormulaR1C1 = "500"
Range("B17").Select
ActiveCell.FormulaR1C1 = "1/19/1902 12:00:00 AM"
Range("A17").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A17:B17").Select
Range("B17").Activate
Selection.Copy
Range("A18:B27").Select
ActiveSheet.Paste
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Values = "='Sheet1'!$A$17:$A$27"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(3).Values = "='Sheet1'!$B$17:$B$27"
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(3).Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(3).ChartType = xlLine
ActiveChart.SeriesCollection(2).Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).ChartType = xlLine
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(2).Border.ColorIndex = 10
ActiveChart.SeriesCollection(3).Border.ColorIndex = 6
'********************SIZES CHART************************
ActiveChart.Parent.Name = "Chart 1"
ActiveChart.ChartArea.Font.Size = 14
With Range("F14:Q38")
ActiveChart.Parent.Left = .Left
ActiveChart.Parent.Top = .Top
ActiveChart.Parent.Width = .Width
ActiveChart.Parent.Height = .Height
End With
'********************************************************
Range("D17:H27").Select
Selection.Style = "Comma"
Selection.NumberFormat = "_(* #,##0_);_(* (#,##0);_(* ""-""??_);_(@_)"
'**************SAVES CHARTS AS IMAGE ***************************
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Export "D:\data\fci_queries\Real Time Stats\Dashboard\backlog_chart_nm.png"
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="D:\data\fci_queries\Real Time Stats\Dashboard\backlog2.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
Application.Quit
End Sub