Hey all,

Currently I have 1 workbook pooling from 6 other workbooks, all of which are password protected. So i was able to find some code that will open those worbooks, enter the password, and then close them in order to update the cells in the main summary workbook. However this presents a scenario where someone could already have a workbook open, and could have it closed on them and thus lose their data. Here is my code as it stands now:

Private Sub Workbook_Open()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Workbooks.Open Filename:= _
"http://.../TEST FOLDER/test1.xlsx", Password:="password"
Calculate
ActiveWorkbook.Close
Workbooks.Open Filename:= _
"http://.../TEST FOLDER/test2.xlsx", Password:="password"
Calculate
ActiveWorkbook.Close
Workbooks.Open Filename:= _
"http://.../TEST FOLDER/test3.xlsx", Password:="password"
Calculate
ActiveWorkbook.Close
Workbooks.Open Filename:= _
"http://.../TEST FOLDER/test4.xlsx", Password:="password"
Calculate
ActiveWorkbook.Close
Workbooks.Open Filename:= _
"http://.../TEST FOLDER/test5.xlsx", Password:="password"
Calculate
ActiveWorkbook.Close
Workbooks.Open Filename:= _
"http://.../TEST FOLDER/test6.xlsx", Password:="password"
Calculate
ActiveWorkbook.Close
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub

So for one workbook the code would be:

Workbooks.Open Filename:= _
"http://.../TEST FOLDER/test1.xlsx", Password:="password"
Calculate
ActiveWorkbook.Close
All of the workbooks are hosted on a sharepoint and accessed by multiple people. So it would be something like:

If workbook: "http://.../TEST FOLDER/test1.xlsx" = open
then calculate
else Workbooks.open
calculate
ActiveWorkbook.Close
I realize the details of that list bit of code are probably terrible but hopefully it helps explain what i want. I'm really new to VBA so please bear with me.

Thanks,
Jwahl