Read Range Workbook: End of Central Directory record could not be found

Read Range Workbook: End of Central Directory record could not be found.
i used worook activities. how to solve this error
assign varible
all file = System.io.directory.getfiles(path) like this i hav mention.

@dhanu_lokhande

The expression you are using will give you a list of files…you should be using for each to read each or use System.io.directory.getfiles(path)(0) to get the first file

Cheers

Hey @dhanu_lokhande could you please post a screenshot of the error and also screenshot of activity where you will be assigning the value here

Regards

Sreejith S S

read range error - why this error is come

@dhanu_lokhande

You have to provide a file location instead you are providing folder location

Cheers

Hi @dhanu_lokhande ,

Combining with the above two methods, Also make sure that the files in the folder are all excel type files.

We can modify the GetFiles() to retrieve only .xlsx files using the below :

allFiles = System.io.directory.getfiles(path,"*.xlsx")

Access the First file retrieved like below :

allFiles(0)

My issue get solved… first I delete those folder and then again i create new folder with same name. then after that i use count function to count the no file present in folder it come as 2 . it means hidden file not count now…