Sign in to follow this  
Followers 0
sailaja

Excel

7 posts in this topic

Hi,

I have dout the format of the Excel sheet in AutoIt is "Filename.xls" of Microsoft Office Excel 97-2003 Worksheet.

When i am trying to execute the application it is placing the alternative value in a text box of particular column.

Why this is happening? Can any one help me regarding this?

Thanks

Sailaja

Share this post


Link to post
Share on other sites



Could you please post the code you have so far? That makes helping you a lot easier :huh2:


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

$oExcel= _ExcelBookOpen("c:\excel.xls")

_ExcelSheetActivate($oExcel, "sss")

This is the code for opening excel sheet and activating the excel sheet.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Insert some error checking. Run this from SciTe and post what you get.

#include <excel.au3>
$oExcel= _ExcelBookOpen("c:\excel.xls")
ConsoleWrite("Open: " & @error)
_ExcelSheetActivate($oExcel, "sss")
ConsoleWrite("Activate: " & @error)

BTW: What you posted can't be the complete script because at least the #include at the top is missing.

Please always post the complete script you use for testing and twhich can reproduce the errorsy ou encounter!

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi,

I have dout the format of the Excel sheet in AutoIt is "Filename.xls" of Microsoft Office Excel 97-2003 Worksheet.

When i am trying to execute the application it is placing the alternative value in a text box of particular column.

Why this is happening? Can any one help me regarding this?

Thanks

Sailaja

Share this post


Link to post
Share on other sites

#include <Excel.au3>

$oExcel = _ExcelBookOpen("C:\Program Files\AutoIt3\CC.xls")

_ExcelSheetActivate($oExcel,"CC")

#region ---Au3Recorder generated code Start ---

Opt("WinWaitDelay",100)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

_WinWaitActivate("CC 47 [Drive: C, A: ABC, CC: 16, CC: 12]","")

MouseClick("left",494,416,1)

_WinWaitActivate("CC 47 [Drive: C, A: ABC, CC: 16, OCE: 12] - Con","")

MouseClick("left",113,438,1)

MouseClick("left",22,137,1)

_WinWaitActivate("CC 47 [Drive: C, A: CC, CC: 16, OCE: 12] - Con - [CC]","")

For $i = 2 To 500

$sCellValue = _ExcelReadCell($oExcel, $i, 2)

MouseClick("left",343,95,1)

Send($sCellValue)

$sCellValue = _ExcelReadCell($oExcel, $i, 1)

MouseClick("left",339,149,1)

Send($sCellValue)

MouseClick("left",611,149,1)

Send($sCellValue)

MouseClick("left",748,147,1)

If WinExists("CCE") Then

_WinWaitActivate("CCE","")

MouseClick("left",228,99,1)

;_WinWaitActivate("CCE","")

;MouseClick("left",408,351,1)

ElseIf WinExists("CC 47 [Drive: C, A: ABC, CC: 16.3, CC: 16.2] - CC - [CC]") Then

_WinWaitActivate("CC 47 [Drive: C, A: ABC, CC: 16.3, CC: 16.2] - CC]","")

MouseClick("left",311,531,1)

MouseClick("left",662,528,1)

EndIf

Next

_ExcelBookClose($oExcel)

#region --- Internal functions Au3Recorder Start ---

Func _WinWaitActivate($title,$text,$timeout=0)

WinWait($title,$text,$timeout)

If Not WinActive($title,$text) Then WinActivate($title,$text)

WinWaitActive($title,$text,$timeout)

EndFunc

#endregion --- Internal functions Au3Recorder End ---

#endregion --- Au3Recorder generated code End ---

This is the code that i am using and facing problem in excel it is placing alternate values in the text box of one particular column

Share this post


Link to post
Share on other sites

You shouldn't mix COM (Excel.au3) and window handling (WinWait, MouseClick etc.) recorded by AU3Recorder.

What are you going to do?

Please describe (e.g. Put value "xyz" into cell "A2" on sheet "sss").

I'm sure that can be done by functions from Excel.au3.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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