Yes, check the permissions to the shared folder. You need to be able to read/write into it. If the shared folder is inaccessible (not connected), you can't read the excel file.
VB.NET, VB or VBA?
VB.NET
Dim sFileName = "S:\newtestBook.xls"
Dim exApp As Excel.Application = Nothing
Dim exBook As Excel.Workbook = Nothing
Dim exSheet as Excel.Sheet = Nothing
dim exRange = Excel.Range = Nothing
Try
exApp = New Excel.Application
exBook = exApp.Workbooks.Open(sFileName)
exSheet = exBook.Worksheets("Sheet1")
exRange = exSheet.Range("A1")
exRange = "Welcome"
Msgbox (exSheet.Range("A1").Text)
Catch ex As Exception
MsgBox (ex.Message, Exclamation, "Error...")
Finally
End Try
VBA/VB
Dim sFileName = "S:\newtestBook.xls"
Dim exApp As Excel.Application
Dim exBook As Excel.Workbook
Dim exSheet as Excel.Sheet
dim exRange = Excel.Range
On Error Goto Err_Handler
Set exApp = New Excel.Application
Set exBook = exApp.Workbooks.Open(sFileName)
Set exSheet = exBook.Worksheets("Sheet1")
Set exRange = exSheet.Range("A1")
exRange = "Welcome"
Msgbox (exSheet.Range("A1").Text)
Exit_Handler:
On Error Resume Next
Exit sub
Err_Handler:
MsgBox (Err.Description, vbExclamation, Err.Number)
Resume Exit_Handler
End Try