VBA Macro running, but not saving to Sharepoint

tispivey

New Member
Joined
Mar 10, 2022
Messages
30
Office Version
  1. 365
Platform
  1. Windows
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.



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
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: VBA Macro running, but not saving to Sharepoint
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: VBA Macro running, but not saving to Sharepoint
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
Sorry, I didn't know both sites were linked. Was just trying to get as much coverage as I could for this issue.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,952
Members
449,095
Latest member
nmaske

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