I have some macros that I use to run daily reports. I did not build them.
I can read and edit macros as needed, but have not mastered building yet.
The problem I am running into is that they run, but are not posting to a Sharepoint site I use. The file opens from the site, acts like it is running, but is not saving back to Sharepoint.
Is there anything in the macro below that would cause it to not save once it finishes updating the report?
I apologize for the format, I am not sure how to properly post a macro here.
I can read and edit macros as needed, but have not mastered building yet.
The problem I am running into is that they run, but are not posting to a Sharepoint site I use. The file opens from the site, acts like it is running, but is not saving back to Sharepoint.
Is there anything in the macro below that would cause it to not save once it finishes updating the report?
I apologize for the format, I am not sure how to properly post a macro here.
VBA Code:
Sub PENDING_TC() ' ' PENDING_TC Macro ' ' Dim I As Integer Workbooks.Open Filename:= _ "[URL]http://mccportal/sites/techops/Daily%20Reports/PENDING%20TROUBLECALLS.xlsb[/URL]" _ , UpdateLinks:=3 ActiveWorkbook.LockServerFile Application.ScreenUpdating = False Application.Calculation = xlCalculationManual 'Copies over pervious TC Pending Count Sheets("Historical").Select Columns("D:D").Select Selection.Insert Shift:=xlToRight Range("C4:C43").Select Selection.Copy Range("D4:D43").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False Range("D3") = ("=c3-1") ActiveSheet.Cells(3, 4).Select Selection.Copy ActiveSheet.Cells(3, 4).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Application.CutCopyMode = False 'Copies over pervious day(s) pending % ' Sheets("Pending Rpt %").Select ' Columns("G:G").Select ' Selection.Insert Shift:=xlToRight ' Columns("F:F").Select ' Selection.Copy ' Range("G1").Select ' Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ ' :=False, Transpose:=False ' Range("G2").Select ' ActiveCell = "=TODAY()" ' ActiveCell.Copy ' Range("G2").Select ' Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ ' :=False, Transpose:=False 'This enters the updated data and enters formulas Sheets("TC PENDING (OW)").Select Columns("A:AW").Select Selection.ClearContents Workbooks.Open Filename:= _ "\\IAALCLUN02\userhome\PUBLIC\NC Finance\Billing Services\Daily Techops Reports\PENDING TC ALL PRINS " & Format(Date, "MM-DD-YY") & ".xls" 'CHG FROM OWEN FLDR TO KIRK "\\IAALCLUN02\userhome\PUBLIC\NC Finance\Daily Work Orders\Work Orders " & Format(Date, "M-D") & "\TC PENDING " & Format(Date - 1, "MMDD") & ".xls" Columns("A:AO").Select Selection.Copy Windows("PENDING TROUBLECALLS.xlsb").Activate ActiveSheet.Paste Application.CutCopyMode = False I = 2 Range("AP1") = "REGION" Range("AQ1") = "SYSTEM" Range("AR1") = "AREA" Range("AS1") = "TOM" Range("AT1") = "SCH'D WEEKDAY" Range("AU1") = "AGED (FROM CREATE)" Range("AV1") = "TOS" Range("AW1") = "COUNT" Do While Range("A" & I) <> "" Range("AP" & I).Formula = "=VLOOKUP(VALUE(CONCATENATE($B" & I & ",$C" & I & ")),'[Master Information Lookup.xlsx]SpaInfo'!$D:$P,9,0)" Range("AQ" & I).Formula = "=VLOOKUP(VALUE(CONCATENATE($B" & I & ",$C" & I & ")),'[Master Information Lookup.xlsx]SpaInfo'!$D:$P,13,0)" Range("AR" & I).Formula = "=VLOOKUP(VALUE(CONCATENATE($B" & I & ",$C" & I & ")),'[Master Information Lookup.xlsx]SpaInfo'!$D:$P,3,0)" Range("AS" & I).Formula = "=VLOOKUP(VALUE(LEFT($O" & I & ",5)),'[Master Information Lookup.xlsx]TomTos>Zip'!$E:$I,5,0)" Range("AT" & I).Formula = "=IF(Y" & I & ">1,VLOOKUP(WEEKDAY(Z" & I & "),$BC$1:$BD$7,2,0),"" "")" Range("AU" & I).Formula = "=(TODAY()-W" & I & ")" Range("AV" & I).Formula = "=VLOOKUP(VALUE(AB" & I & "),'[Master Information Lookup.xlsx]Tech #s'!$A:$C,3,0)" Range("AW" & I).Formula = "=COUNT(A" & I & ")" I = I + 1 Loop Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True Sheets("Historical").Select Range("C11").Select ActiveSheet.PivotTables("PivotTable13").PivotCache.Refresh ActiveWorkbook.Save ActiveWindow.Close ActiveWindow.Close End Sub