Catching File not found exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • perl15
    New Member
    • Nov 2008
    • 3

    #1

    Catching File not found exception

    Hi all,

    I am trying open web pages , the urls of which are stored in a table in database. My problem is when an undefined url comes, an OLE exception occurs and aborts the program. I want to catch this exception and print an error message for that particular url and proceed further with others.
    The page(intranet page) consists of an excel sheet whose data i am copying into another excel sheet.
    How do i check whether excel file in the url is active or not?

    Kindly help me in this issue.
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    If you are wanting to test to see if a file exists, then there are file test operators to assist with that.

    Regards,

    Jeff

    Comment

    • perl15
      New Member
      • Nov 2008
      • 3

      #3
      Hi numberwhun ,

      Thanks for your response.
      I tried as u suggested, it is working fine if it is a windows file , it is not working if i give a url. Kindly help.

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        file test operators do not work on URLs but I also don't understand your question very well. You can use the eval function to catch fatal erros and trap them, see the eval documentation. There might be other ways as well but they would be specific to your code, which we can't see.

        Comment

        • perl15
          New Member
          • Nov 2008
          • 3

          #5
          Hi Kevin,

          Thanks for ur advise. I tried putting it in a try-catch error block. I am able to handle it now :-)

          Comment

          Working...