Any reason the following code does not find the Excel file? If I force workbook open I get run-time error 1004.
Actual address from address bar = C:\Users\dell\Dropbox\Prefab\Common\Reminder.xlsm. Thanks in advance
I am bad at Excel and this forum saves my but - lol
Actual address from address bar = C:\Users\dell\Dropbox\Prefab\Common\Reminder.xlsm. Thanks in advance
VBA Code:
Sub OpenReminders()
Dim y As Workbook
Dim Root As String
Dim sPath As String
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Root = Left(ThisWorkbook.Path, InStr(1, ThisWorkbook.Path, ":\"))
sPath = Root & Application.PathSeparator & "Users\del\Dropbox\Prefab\Common\" & "Reminder.xlsm"
'MsgBox sPath
If fso.FileExists(sPath) Then 'Testing for existance of reminder.xlsm
MsgBox "yes does exist"
Set y = Workbooks.Open(sPath)
Else
MsgBox "no does not exist"
End If
End Sub
I am bad at Excel and this forum saves my but - lol