Debug error due to StPath
Hi all,
I am getting a debug error on the below VBA that i am sure is to to with the fact the Excel spreadsheet it on a public networked drive. It seems to be always looking at my C drive so going like this C:\Colin\\1035492-f01\shared$\Public\Colin\test.xlsx
enviro = CStr(Environ("USERPROFILE"))
'the path of the workbook
strPath = enviro & "\\1035492-f01\shared$\Public\Colin\test.xlsx"
On Error Resume Next
Set xlApp = GetObject(, "Excel.Application")
If Err <> 0 Then
Application.StatusBar = "Please wait while Excel source is opened ... "
Set xlApp = CreateObject("Excel.Application")
bXStarted = True
End If
On Error GoTo 0
'Open the workbook to input the data
Set xlWB = xlApp.Workbooks.Open(strPath)
Set xlSheet = xlWB.Sheets("Sheet1")
Can you help?
Many thanks in advance