Emi
Emi

Reputation: 484

Is it possible to check if a csv file has any data in it from VBA?

Is it possible to check if a csv file has any data in it from VBA?? I want to import CSV file to access. It works fine if there is data in the CSV file but error occurs when there is no data in the CSV file.

Upvotes: 2

Views: 1849

Answers (1)

Tr1stan
Tr1stan

Reputation: 2775

You can use the FileLen function:

If FileLen("C:\your_dir\file_to_read.csv") = 0 Then MsgBox "Csv file is empty"

Upvotes: 3

Related Questions