I want to create a excel file from my script if it does not exist.
_ExcelBookOpen throws error=2 if file does not exist, after this error i want to create new file at this point.
can i use _FileCreate()?
_Logger($sLogPath, "{INFO}------: Opening Excel File: " & $sExcelPath& "")
While 1
Local $oExcelTestResult = _ExcelBookOpen($sExcelPath)
If @error = 2 Then
If not _FileCreate($sResExcelPath) Then
MsgBox(0, "Error", "Error In Opening REsult Excel File: Error: " & String(@error))
_Logger($sLogPath, "{ERROR}------: Result Excel File does not exist.. tried to create new but :ERROR : " & String(@error) & "")
ExitLoop
Else
_Logger($sLogPath, "{INFO}------: Result Excel File does not exist.. **Created New**: ")
EndIf
Else
ExitLoop
EndIf
WEnd