Check if multiple file exist on a sharepoint

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
https://My.sharepoint.com/sites/RevenueManagement/Our Documents/R&R Tracker/Month Occupancy & Revenue by Rate code Reports/2017/July/QQZBA.xls

<tbody>
</tbody>


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 :)
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,216,031
Messages
6,128,422
Members
449,450
Latest member
gunars

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