08-08-2016 03:07 AM
Hallo,
how can i check if a excel file is open or not open. I need a code for the diadem script.
thanks
Solved! Go to Solution.
08-08-2016 03:58 AM - edited 08-08-2016 04:00 AM
You can use code like this to make sure that a file is accessible exclusively.
Option Explicit
dim xlsxFile : xlsxFile = "C:\temp\out_EXPORT.xlsx"
MsgBox FileAccessible(xlsxFile)
function FileAccessible(byref filePath)
FileAccessible = FALSE
dim fh : fh = TextFileOpen(filePath, eTextFileAttributeExclusive OR eTextFileAttributeRead OR eTextFileAttributeANSI)
if -1 <> fh then
call TextFileClose(fh)
FileAccessible = TRUE
end if
end function
08-08-2016 07:35 AM
perfect, thank you