Sign in to follow this  
Followers 0
zasxes

Error: Unable To Open File, The Maximum Number Of

3 posts in this topic

How do I resolve this issue, I dont think I am doing anything wrong in the script. Take a look

The Error:_____________________________________________________

AutoIT Error:

Line 610 (File C:\SiteSep_new.au3):

$LOG = FileOpen($LOGNAME & ".csv", 1)

Error: Unable to open file, The maximum number of open files has been exceeded.

_________________________________________________________________

The code:

All Variables are declared

Func SUCCESS()

WinWait("classname=IEFrame")

If Not WinActive("classname=IEFrame","") Then WinActivate("classname=IEFrame","")

WinWaitActive("classname=IEFrame","")

WinShow("classname=IEFrame","", @SW_MAXIMIZE)

$TITLE2=WinGetTitle("","")

If $TITLEX = $TITLE2 Then ;==>TEST Title

$DIF = Round(TimerStop($BEGIN1))

$DIF=$DIF/1000

$LOGLINE=$TITLEX & "," & "OK," & $START & "," & @HOUR & ":" & @MIN & "," & $DIF & "," & $LSTOP1 & "," & $FSTOP1 & "," & $FSTOP2 & "," & $SSTOP1 & "," & $SSTOP2 & "," & $PSTOP1 & "," & $PSTOP2 & "," & $ESTOP1 & "," & $ESTOP2 & "," & $BSTOP1

$LOG = FileOpen($LOGNAME & ".csv", 1) ;LINE 610

If $LOG = -1 Then ;==> Check Log

MsgBox(0, "Error", "Unable to open LOG.")

EndIf ;==> Check Log

FileWriteLine($LOG, $LOGLINE)

FileClose($LOG)

WinClose($TITLE2)

Else

WinClose($TITLE2)

EndIf ;==>TEST Title

EndFunc ;==>SUCCESS

Share this post


Link to post
Share on other sites



There is a limit to the number of open files you can have, that limit is set at 64. Are you opening any other files in your script? Are you opening a file in a loop (While, For, Do) and maybe missing a FileClose() somewhere? Something in your script has caused a bunch of files to be open and you can't open any more.

Share this post


Link to post
Share on other sites

Ok I think I found the issue. Thanks

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  
Followers 0