Jump to content
Sign in to follow this  

Reading Excel File error

Recommended Posts



Hi, Is there a way to lock the excel file while it's being read. Like when the process between _ExcelBookOpen() and _ExcelBookClose() in that time if another _ExcelBookOpen() tries to open the file it gives an error message for something? So, basically when a excel book is open another instance of that book shouldn't get opened. Thanks for all the help!!

$File1 = "c:\test.xls" 

    $i = _ExcelBookOpen($File1,0)               
    $m = _ExcelReadCell($i,1,1)
        MsgBox(0, "No is", $m)
Edited by Jat421

Share this post

Link to post
Share on other sites

From what I understand and from my own experience...

If you have permission to write to it from the account that's opening it, then it should lock it soon as it opens unless you specify to open in read-only mode.

If you don't have write permissions on the file or if something else has it open already then AutoIt will open in read-only mode automatically.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this