I use the following code to open up a workbook in a macro that I created:
Workbooks.Open "E:\DBTest.xls"
Set wbTemp = ActiveWorkbook
The problem is that if the workbook is already opened, an error occurs. IS there a way to use an IF statement so that if an error occurs, I send a message to the user saying that the workbook is already opened (MsgBox "The Workbook is already opened - Try again later!" and then it stops the macro from running?
THanks!!!!!!
Workbooks.Open "E:\DBTest.xls"
Set wbTemp = ActiveWorkbook
The problem is that if the workbook is already opened, an error occurs. IS there a way to use an IF statement so that if an error occurs, I send a message to the user saying that the workbook is already opened (MsgBox "The Workbook is already opened - Try again later!" and then it stops the macro from running?
THanks!!!!!!