Jump to content

ActiveX


roy
 Share

Recommended Posts

@Analritter

It is working !! But you might need to change the version of Office you are using.

;9 = Office 2000 (?) , 10 = Office XP , 11 = Office 2003
ObjCreate("OWC10.Spreadsheet.10")

@Roy

Nice job.

COM object integrated in AutoIt is the BEST thing that happened lately.

Link to comment
Share on other sites

@Analritter

It is working !! But you might need to change the version of Office you are using.

;9 = Office 2000 (?) , 10 = Office XP , 11 = Office 2003
ObjCreate("OWC10.Spreadsheet.10")

@Roy

Nice job.

COM object integrated in AutoIt is the BEST thing that happened lately.

<{POST_SNAPBACK}>

im not using office... im using open office...

[font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font]

Link to comment
Share on other sites

Guest huuugo

The code throws the following error:

Line 30 (...

MsgBox(0,"Evaluate=AVERAGE(5,15,25,33)",$oSpreadSheet.ActiveSheet.Evaluate("=AVERAGE(5,15,25,33)"))

MsgBox(0,"Evaluate=AVERAGE(5,15,25,33)",$oSpreadSheet.ActiveSheet.E^ERROR

Error: Unable to parse line

Link to comment
Share on other sites

i find this method just amazing ... i made some small experiments with that code. i have windows XP and only office 2000 ...

the right syntax i found for line 7 is the following :

$oSpreadSheet = ObjCreate("OWC.Spreadsheet")

[found a bit by chance...]

i got errors for methods autofit and evaluate which don't seem to be supported in my context (pb of OWC version ?) ...

the most complicated in this OWC programming i really discover is getting the right syntax and the way to call object ...

where do u guys find good reference about OWC programming ?

thanks for ur help !

Link to comment
Share on other sites

Just a Word ObjCreate example - There's a lot of options to this control but I could not make it embedded so I skipped the project, maýbe someone else can do the trick but I'm not shure that this particulare object can be made embedded at all...

$oWD = ObjCreate("Word.Application")
$GUIActiveX = GUICtrlCreateObj( $oWD, 0, 0 , 640 , 480 )
$SinkObject = ObjEvent($oWD,"IEEvent_","Word"); Event dummy
SetAppOptions($oWD)

$filein = 'C:\\Dokumenter\\Text.doc'; must exist
With $oWD
    .Documents.Open($filein)
    .Visible = True; do not change this
    .Caption = "My New word title"
    .DisplayStatusBar = True
;.Documents.Add($filein)
EndWith

MoveResizeWindow($oWD,100,150,600,300)
;$oIE.Documents.Save()
;$oIE.Quit
Exit

Func MoveResizeWindow($o,$x,$y,$w,$h)  
    $o.Move($x, $y)
    $o.Resize($w, $h)
EndFunc

Func SetAppOptions($o) 
;Set various application options. 
    $o.Options.BackgroundSave = False 
    $o.Options.Overtype = False
EndFunc

Information can be found here:

http://msdn.microsoft.com/library/default....nproperties.asp

kjactive :)

Edited by kjactive
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...