"ON ERROR GOTO"

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

Krappo,

What you need to do is seperate the 2 Open calls into
different procedures. Something like this:

Sub openBook2()

On Error Goto AAA
Workbooks.Open Filename:="C:\dir\dir\book2.xls"
Exit Sub

AAA:
MsgBox "Book2 not Found"
openBook3

End Sub

Sub openBook3()

On Error Goto BBB
Workbooks.Open Filename:="C:\dir\dir\book3.xls"
Exit Sub

BBB:
MsgBox "Book3 not Found"

End Sub

I don't under your second question: "write a ***msgbox so
that it display as I type (line by line in one single
message)."
 
Krappo,

MsgBox Prompt:="The book you've requested no found." & _
vbCrLf & "Either you have missplaced the book" & _
vbCrLf & "or such book is not present."

the vbcrlf is carriage return line feed (ie enter)

Dan E
 
Thanks Dan E,

That was wonderfull! I appreciate your help and I really looking for
that solutions.

Thanks to both of you, Ed who have settled my first question and to
you for the second questions.

Best wish to both of you.
Krappo.
 
Back
Top