Hi,
Thank u for the reply.
First i tried to work on this project using simulated data, with which i able to open the file and copy the data.
But failed in appending data. Immediately started working on the pseudo code what u given.
Later i got the files on what i need to work on. Here i am facing another issue, i am unable to open the file.
When i opened normally(directly with out script) it is saying the excel sheet consists unreadable characters
do u want me to open. May be because of this, i am unable to open using script. Can u help me in this.
Error: Fail to open "First file name in the folder"
This is the script what i wrote:
#include <File.au3>
#include <Array.au3>
#include <Excel.au3>
#include <Constants.au3>
#include <MsgBoxConstants.au3>
;
; AutoIt Version: 3.0
; Language: English
; Platform: Win9x/NT
; Author: Raviteja
;
; Script Function:
Local $i
Local $j
Local $l = 1
Local $path = "D:\AUTO_IT\Simulator\"
; Create application object
Local $oExcel = _Excel_Open()
If @error Then Exit MsgBox(16, "Excel UDF: _Excel_BookOpen Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended)
$newbook = _Excel_BookNew($oExcel, 5)
Local $FileArray = _FileListToArray($path,"*.xlsm")
For $i = 1 To $FileArray[0]
Local $book = _Excel_BookOpen($oExcel, $path & $FileArray[$i])
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Error", "Fail to open " & $FileArray[$i], 0)
For $j = 14 To 24 ; For now i made it fixed
_ExcelReadCell($book, $j, 2)
_ExcelWriteCell($newbook, $l, 2)
$l = $l + 1
Next
Next
_Excel_BookSaveAs($newbook, "D:\AUTO_IT\Final_Report\Report.xlsx", $xlWorkbookDefault, True)
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Status", "Failed to save " & "Report", 0)
MsgBox($MB_SYSTEMMODAL, "Status", "Saved successfully", 0)
Sleep(2000)
_Excel_Close ($oExcel)