blantek212

_Excel_RangeRead from active Excel file

3 posts in this topic

Hello,
I have some problem with my code.
I try to use command "_Excel_RangeRead", it  works when AutoIt opens new excel file, code like below

Local $oExcel = _Excel_Open()
Local $oWorkbook = _Excel_BookOpen($oExcel, "path")
$copy_cell = _Excel_RangeRead($oWorkbook, $oWorkbook.Activesheet, "A1")


But I don't have any idea how read cell in excel (without open new file), when I have already opened excel file.
I try to run code below, but it doesn't work correct, $copy_cell return 0.
 

Local $oExcel = ObjGet("", "Excel.Application")
 $oExcel.Visible = 1
$copy_cell = _Excel_RangeRead($oExcel, Default, "A1")

Has anybody any idea how to solve this?

Share this post


Link to post
Share on other sites



You should still use _Excel_Open to connect to the Excel application and _Excel_BookAttach to connect to the open Excel workbook.
The help file is your friend ;)

1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2016-08-18 - Version 1.4.6.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2016-07-20 - Version 1.2.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
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