Jump to content
Sign in to follow this  
tempman

_ExcelReadCell

Recommended Posts

tempman

#include <Excel.au3>
#include <Array.au3>

$sFilePath1 = @ScriptDir & "\ipligence-lite.xlsx"
Local $oExcel = _ExcelBookOpen($sFilePath1, 0)

$aArray = $oExcel.Activesheet.Range("A1:A170241").Value
_ArrayDisplay($aArray)

_ExcelBookClose($oExcel, 0, 0)
Exit

array is display in coloms and i want to display it in rows

Share this post


Link to post
Share on other sites
water

Haven't tested it but I think the array is to large to use the Excel transpose function:

$aArrayTransposed = $oExcel.Transpose($aArray)

If it crashes you have to manually create the new array.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
tempman

since I am 67 posts memeber you need to show me where to put that line? :(

Share this post


Link to post
Share on other sites
jdelaney

maybe: _ArrayDisplay(Const ByRef $avArray [, $sTitle = "Array: ListView Display" [, $iItemLimit = -1 [, $iTranspose = 0 [, $sSeparator = "" [, $sReplace = "|" [, $sHeader = ""]]]]]])

But who cares how the array is displayed, what are you attempting to do with the data: that's where the logic of the script comes into play

If you want to actually take the data of the column, and transpose to the rows, you will cutt off some of your data...there are not that many columns avaialbe in excel 2010

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites
water

After line:

$aArray = $oExcel.Activesheet.Range("A1:A170241").Value


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
tempman

#include <Excel.au3>
#include <Array.au3>

$sFilePath1 = @ScriptDir & "\ipligence-lite.xlsx"
Local $oExcel = _ExcelBookOpen($sFilePath1, 0)

$aArray = $oExcel.Activesheet.Range("A1:A170241").Value
$aArrayTransposed = $oExcel.Transpose($aArray)
_ArrayDisplay($aArrayTransposed)

_ExcelBookClose($oExcel, 0, 0)
Exit

>Running:(3.3.8.1):C:\Program Files\AutoIt3\autoit3.exe "D:\z.au3"

--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop

D:\z.au3 (8) : ==> The requested action with this object has failed.:

$aArrayTransposed = $oExcel.Transpose($aArray)

$aArrayTransposed = $oExcel.Transpose($aArray)^ ERROR

->20:04:39 AutoIT3.exe ended.rc:1

>Exit code: 1 Time: 5.025

Share this post


Link to post
Share on other sites
water

Looks like the array is too large for Excel. In this case you either need to transpose the table yourself.

Or if you just need to process the table then process rows as columns and columns as rows.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
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  

×