Unsolved Check file is open or not
-
@Pradeep-Kumar yup .. but i want solution.
-
@Gaurav-Badgujar said in Check file is open or not:
i opened excel file in ms-excel and i want to check excel file is open or not.
What? You open an Excel file in Excel and then you want to check whether Excel opened the file?
Do you open this Excel file manually or from your Qt app? Why do you want to check this? -
@jsulm yes open manually and want to check for requirement.
-
@Gaurav-Badgujar Do you want to check this in your Qt app?
-
@jsulm yes
-
There is no Qt way of doing this.
Its pr. operating system and you will need to use native API to do it.for windows
https://stackoverflow.com/questions/1951791/how-to-check-if-a-file-is-already-open-by-another-process-in-c -
You can check if a specific Excel file is open using ActiveQt
get all WorkBooks, iterate over them and check if the name of the workbook you touch corresponds to the one you want.
If that is the case, your excel file is already open. -
@Eddy
That is not a bad idea.
I even think that
ThisWorkbook.FullName
Workbook.FullName
will give full path to file. -
@mrjj
Yes, that is possible, but other files can be open already and the one we want to check is not necessarily the active one.Eddy
-
@Eddy
Oh bad naming. I did mean when he looped over all open.