drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 543
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and Thanks in advance!
In one of my folders I have the following files:
"~$San James---CREA LC.xlsm"
"Book1.xlsx"
"Paula Smith---COL GC.xlsm"
"~$Rams Dyz---GPOA.xlsm"
I am using a macro to list all the files whithin a specific folder and then to get the data contained in one of their sheet's.
I am doing this NOT opening the file, and Works FINE!
my problem comes when one of my clients send me this files and when I do try to open or to extarct the data contained in eg the file:
"~$San James---CREA LC.xlsm"
I get the following message:
Excel cannot open the file xxx because the file format or file extension is not valid. Verify the file has not been corrupted and that the file extension matches the format of the file.
When listing the files I could avoid this kind of files easy, because those file's FileLen is < 5KB. or because left(TheFile,1)="~"
BUT...
is the any way to check if a Excel File is Valid using a code line like eg:
Thanks!
In one of my folders I have the following files:
"~$San James---CREA LC.xlsm"
"Book1.xlsx"
"Paula Smith---COL GC.xlsm"
"~$Rams Dyz---GPOA.xlsm"
I am using a macro to list all the files whithin a specific folder and then to get the data contained in one of their sheet's.
I am doing this NOT opening the file, and Works FINE!
my problem comes when one of my clients send me this files and when I do try to open or to extarct the data contained in eg the file:
"~$San James---CREA LC.xlsm"
I get the following message:
Excel cannot open the file xxx because the file format or file extension is not valid. Verify the file has not been corrupted and that the file extension matches the format of the file.
When listing the files I could avoid this kind of files easy, because those file's FileLen is < 5KB. or because left(TheFile,1)="~"
BUT...
is the any way to check if a Excel File is Valid using a code line like eg:
Code:
if Fx_bFileIsOK("C:~$San James---CREA LC.xlsm") then...
Thanks!