View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chris Putzig Chris Putzig is offline
external usenet poster
 
Posts: 5
Default Cant find workbook

Try this:

On Error Resume Next 'disable error
myBook =TextBox6.Value
Set testOpened = Workbooks.Open(myBook)
If Not IsObject(testOpened) Then
MsgBox myBook & " not found"
End If
On Error GoTo 0 'reset error

....Chris

"Todd Huttenstine" wrote in message
...
The below code opens the workbook in Textbox6.
Workbooks.Open TextBox6.Value

If the workbook is not located, I get a VBA error, instead
I would like a messagebox to popup and say "Workbook not
found." and then exit sub.

Thanx

Todd Huttenstine