I was looking at this macro on Microsoft's support website when something occurred to me:
Sub MyMacro()
Dim MyWorkbook As Workbook
' Run the Error handler "ErrHandler" when an error occurs.
On Error GoTo Errhandler
ChDrive "B:"
ChDir "B:\"
ChDir "B:\XLFiles"
Workbooks.Open "Book1.xls"
What are the last four lines describing? Are they detailing a file path to 'Book1.xls' that's in B:\XLFiles or is it something else? Furthermore, how can 'ChDir' be defined twice?
Thanks!
Sub MyMacro()
Dim MyWorkbook As Workbook
' Run the Error handler "ErrHandler" when an error occurs.
On Error GoTo Errhandler
ChDrive "B:"
ChDir "B:\"
ChDir "B:\XLFiles"
Workbooks.Open "Book1.xls"
What are the last four lines describing? Are they detailing a file path to 'Book1.xls' that's in B:\XLFiles or is it something else? Furthermore, how can 'ChDir' be defined twice?
Thanks!