﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1546	Creating new excel book is not working.	bnashwath		"I have include Excel.au3 header file in my code. I am trying to open new excel sheet. but i am getting error in header file line number 153. As soon as compiler executes _ExcelBookNew()from header file Excel.au3. its stops at line no 153 saying error. I am gettin following error :
'''C:\Program Files\AutoIt3\Include\Excel.au3 (153) : ==> The requested action with this object has failed.:
.ActiveWorkbook.Sheets(1).Select ()
.ActiveWorkbook.Sheets(1).Select ()^ ERROR
>Exit code: 1    Time: 1.855'''


----

Below is the code which opens excel sheet saves with specific name.

; Script Start - Add your code below here
;Include file for excel sheet operation
#Include <Excel.au3>

;To open new excel sheet
$oExcel = _ExcelBookNew()  ;[$fVisible = 1]
;check for errors
If @error =1 Then 
MsgBox(0, ""Status"", ""Unable to create the Excel COM object"", 3)
EndIf
;Save the File as 'Baselinetestreport.xls""
_ExcelBookSaveAs($oExcel, @ScriptDir & ""\baselinetest\BaselinetestReport"", ""xls"", 0, 1) 
;Check for errors
If Not @error Then 
MsgBox(0, ""Success"", ""File was Saved!"", 3)
EndIf
;This method will save then Close the file, without any of the normal prompts, regardless of changes
_ExcelBookClose($oExcel, 1, 0) 

----
"	Bug	closed		AutoIt	3.3.4.0	None	Works For Me		
