-
Hi,
I need to open file in my apps directory, like the following:
Code:
Set wbkWorkbook = objExcel.Workbooks.Open(App.Path & "\" & "Orders.xls")
Problem is that if the file is in ROOT directory, I'll get an error
because of the slash between App.Path & the "Orders.xls".
How can I test if my file is in the root directory or not, and what's
the correct syntax for fixing this problem.
-
Code:
If right(app.path,1) = "/" then
Set wbkWorkbook = objExcel.Workbooks.Open(App.Path & "Orders.xls")
else
Set wbkWorkbook = objExcel.Workbooks.Open(App.Path & "\" & "Orders.xls")
End If