View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Richard Buttrey Richard Buttrey is offline
external usenet poster
 
Posts: 296
Default How to determine the length of a .prn file.

On 23 Jun 2004 03:09:33 -0700, (Richard
Buttrey) wrote:

One of my VBA macros opens and then imports a .prn or .txt file into
an excel workbook.

Sometimes the number of records in the file exceed the maximum rows
permitted by a single Excel worksheet.

How can I test for the number of rows in the file before opening,
parsing and copying it into my workbook? If it exceeds say 65500 rows
I'd like to pop up a message and then exit the Sub.

TIA

Richard Buttrey


Thanks to both Nikos and Jamie for your prompt replies.

I'll be trying your suggestions out in the next day or two.
Kind regards

Richard Buttrey
Grappenhall, Cheshire, UK
__________________________