Spin_Jockey
New Member
- Joined
- Jul 14, 2017
- Messages
- 1
Hi,
Sorry quite new to this and i am looking to check if a number of files exist on a share point and what i have is the following code
Sub Report_Check()
Application.ScreenUpdating = False
qwork = ActiveWorkbook.Name
Sheets("File Check").Select: Range("b2").Select
qpath = ActiveCell
qmreport = ActiveCell.Offset(1, 0).Value
qyreport = ActiveCell.Offset(2, 0).Value
qplreport = ActiveCell.Offset(3, 0).Value
qcuryear = ActiveCell.Offset(4, 0).Value
qpriyear = ActiveCell.Offset(5, 0).Value
qmonth = ActiveCell.Offset(6, 0).Value
qfile1 = ActiveCell.Offset(12, 0).Value
qfile2 = ActiveCell.Offset(13, 0).Value
qfile3 = ActiveCell.Offset(14, 0).Value
' Check Month Occ & Rev files for current year
Workbooks.Open qpath & qmreport & qcuryear & qmonth & qfile1 & ".xls"
ActiveWindow.Close
Workbooks.Open qpath & qmreport & qcuryear & qmonth & qfile2 & ".xls"
ActiveWindow.Close
Workbooks.Open qpath & qmreport & qcuryear & qmonth & qfile3 & ".xls"
ActiveWindow.Close
The path i am opening from then looks like
[TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]https://My.sharepoint.com/sites/RevenueManagement/Our Documents/R&R Tracker/Month Occupancy & Revenue by Rate code Reports/2017/July/QQZBA.xls[/TD]
[/TR]
</tbody>[/TABLE]
The above works but as i am opening around 300 files in total (omitted rest of code as only repeats for different files) it takes a long time to run and fails at the first missing file when i really want to see all missing files in one go.
Any help would be most appreciated i have searched through the forum for anything similar and tried filepath and Dir to no avail.
Thanks in advance
Sorry quite new to this and i am looking to check if a number of files exist on a share point and what i have is the following code
Sub Report_Check()
Application.ScreenUpdating = False
qwork = ActiveWorkbook.Name
Sheets("File Check").Select: Range("b2").Select
qpath = ActiveCell
qmreport = ActiveCell.Offset(1, 0).Value
qyreport = ActiveCell.Offset(2, 0).Value
qplreport = ActiveCell.Offset(3, 0).Value
qcuryear = ActiveCell.Offset(4, 0).Value
qpriyear = ActiveCell.Offset(5, 0).Value
qmonth = ActiveCell.Offset(6, 0).Value
qfile1 = ActiveCell.Offset(12, 0).Value
qfile2 = ActiveCell.Offset(13, 0).Value
qfile3 = ActiveCell.Offset(14, 0).Value
' Check Month Occ & Rev files for current year
Workbooks.Open qpath & qmreport & qcuryear & qmonth & qfile1 & ".xls"
ActiveWindow.Close
Workbooks.Open qpath & qmreport & qcuryear & qmonth & qfile2 & ".xls"
ActiveWindow.Close
Workbooks.Open qpath & qmreport & qcuryear & qmonth & qfile3 & ".xls"
ActiveWindow.Close
The path i am opening from then looks like
[TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]https://My.sharepoint.com/sites/RevenueManagement/Our Documents/R&R Tracker/Month Occupancy & Revenue by Rate code Reports/2017/July/QQZBA.xls[/TD]
[/TR]
</tbody>[/TABLE]
The above works but as i am opening around 300 files in total (omitted rest of code as only repeats for different files) it takes a long time to run and fails at the first missing file when i really want to see all missing files in one go.
Any help would be most appreciated i have searched through the forum for anything similar and tried filepath and Dir to no avail.
Thanks in advance
