Jump to content
Sign in to follow this  
Aceguy

excel documents

Recommended Posts

Aceguy

how do i write to an existing (already opened) excel document....

becase all the examples in the helpfile just manipulate new() or open() one......

_ExcelWriteCell($oExcel, "I Wrote to This Cell", 1, 1)

$oExcel wont exist...

TY

Share this post


Link to post
Share on other sites
Authenticity

Hmm..

Dim $oExcel = _ExcelBookAttach()

..and then maybe

Dim $oSheet = $oExcel.ActiveSheet

depending if _ExcelBookAttach() could successfully attach to the Excel instance.

Share this post


Link to post
Share on other sites
Authenticity

Man, I must say that I don't think it should match exactly the title. Why not using just StringInStr, more flexibility in my opinion. Oh, by the way, it returns __Workbooks, so to get the sheet use $oSheet = $oExcel.Application.ActiveSheet.

Share this post


Link to post
Share on other sites
Aceguy

#include <Excel.au3>
$title=WinGetTitle("Microsoft Excel","")

if not $title=0 then
$oExcel = _ExcelBookAttach($title, "Title")

Else
    $oExcel=_excelbooknew()
EndIf

$d=0
Do
$d+=1
$read=  _excelreadcell($oExcel,$d,1)
until $read=""
ConsoleWrite("end of row is "&$d&@lf)

:D

used this to find the last entry in colomn 1..... TY Authenticity

Edited by Aceguy

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.