Jump to content
Sign in to follow this  
Pachan

Moving data from 1st xl sheet to 2nd sheet and accumilating data in second sheet

Recommended Posts

Pachan

Hi Team,

I am Moving data(list 3) from 1st xl sheet to 2nd sheet and accumilating data in second sheet. But it not work, can somebody help.

[ autoit ]

#include <File.au3>

#include <Excel.au3>

#include <Array.au3>

$VisibilityFlag = 1; 0 = Invisible mode, 1 = visible mode

$startColumn = 19

Local $oExcel = _ExcelBookOpen("D:\AccesibilityTesting\Autoit.xlsx") ;Create new book, make it visible

If @error = 1 Then

MsgBox(0, "Error!", "Unable to Create the Excel Object")

Exit

ElseIf @error = 2 Then

MsgBox(0, "Error!", "File does not exist")

Exit

EndIf

$aArray4Display = _ExcelReadSheetToArray($oExcel,1,1) ;Using Default Parameters

_ExcelBookSave($oExcel,0) ;Save File With No Alerts

Sleep(500)

Send("{ENTER}")

Send("{ENTER}")

If Not @error Then MsgBox(0, "Success", "File was Saved!", 3)

_ExcelBookClose($oExcel) ; And finally we close out

Local $oExcel1 = _ExcelBookOpen("D:\AccesibilityTesting\Autoit.xlsx")

If @error = 1 Then

MsgBox(0, "Error!", "Unable to Create the Excel Object")

Exit

ElseIf @error = 2 Then

MsgBox(0, "Error!", "File does not exist !")

Exit

EndIf

Sleep(500)

;ConsoleWrite($aArray4Display)

;_ArrayDisplay($aArray4Display, "Array using Default Parameters")

_ExcelSheetActivate($oExcel1, "Sheet2")

_ExcelWriteArray($oExcel1, $startColumn, 1, $aArray4Display) ; Write the Array

If @error = 0 Then

ConsoleWrite("No error")

EndIf

_ExcelBookSave($oExcel1,0) ;Save File With No Alerts

Sleep(500)

Send("{ENTER}")

Send("{ENTER}")

If Not @error Then MsgBox(0, "Success", "File was Saved!", 3)

_ExcelBookClose($oExcel1) ; And finally we close out

[/ autoit ]

Thanks,

Thomas

Note : attached xl sheet

Share this post


Link to post
Share on other sites
Pachan

Hi Team,

sorry cannot attach xl sheet. Please find details bellow. I wand to past list 3 details in sheet 2 from sheet 1 in the end

Thanks,

Thomas

Note :

xl sheet content

sheet 1

list 3

Guideline Line Column

5 5091

6 16

sheet 2

list 1

Guideline Line Column

5 5091

6 16

list 2

Guideline Line Column

5 5091

6 16

Share this post


Link to post
Share on other sites
enaiman

Unfortunately _ExcelWriteArray does not work with 2D arrays (which is what you get when using _ExcelReadSheetToArray) and that's why you get that error.

It seems that the author forgot to add this bit of information to the UDF.

In this case you will need to use _ExcelWriteSheetFromArray; it does support a custom start row/column.

If you don't add extra white spaces in your [autoit] tags they will work :blink:

EDIT: what are these for? Send("{ENTER}") ?

Edited by enaiman

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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  

×