Can anyone suggest, how to check if xls file empty or not?
I have tried FileInfo("fname").Length == 0 But it’s not working.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An “empty” Excel file will still have an Excel file header, which is why your test for a size of 0 is failing.
You can use Excel Interop to see what the UsedRange is:
http://social.msdn.microsoft.com/Forums/en-US/exceldev/thread/b9cdfbd7-5ae9-41f7-b7e8-ebc00e835d45#546316e8-8745-42e8-9c0d-063d1373dfbe