By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,710 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,710 IT Pros & Developers. It's quick & easy.

Catching File not found exception

P: 3
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.
Nov 17 '08 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 2.5K+
P: 3,503
If you are wanting to test to see if a file exists, then there are file test operators to assist with that.


Nov 17 '08 #2

P: 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.
Nov 18 '08 #3

Expert 2.5K+
P: 4,059
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.
Nov 18 '08 #4

P: 3
Hi Kevin,

Thanks for ur advise. I tried putting it in a try-catch error block. I am able to handle it now :-)
Nov 18 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.