Leagnus Posted March 17, 2009 Share Posted March 17, 2009 (edited) Though "COM" is not exact what OOo services are – I've given the name for easy searchin through plenty of themes.May be OOoUNO_UDF is better?Basic functions to use Open Office Calc in AutoIt scripts .OOoCOM_UDF.au3OOoCOM_UDF.au3Feel free to post here a bug or proposition .Tested with OOo 3.0.1.For testing you can use xls-fileimport.zipExample scripts are:OpenOffice_Examples.zipBig thanks to SEO <locodarwin at yahoo dot com> for ideas in ExcelCOM_UDF.au3 Edited June 19, 2009 by Leagnus Link to comment Share on other sites More sharing options...
enaiman Posted March 17, 2009 Share Posted March 17, 2009 Very good job I might be using it very soon. I haven't tested it yet but it seem to have all we need to do basic tasks. Thank you for sharing it with us. I'm looking forward to new additions SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
rec9140 Posted March 19, 2009 Share Posted March 19, 2009 Though "COM" is not exact what OOo services are – I've given the name for easy searchin through plenty of themes.Thanks....and I will be keeping an eye out for later versions. As I will be eagerly awaiting additional options such as the Excel sheet equivalents for use in OOI use:_ExcelReadArray_ExcelSheetUserdRangeGet_ExcelBookOpenHaving the OO equivalent of these would let users who don't have excel installed (all non management users) use my program v. it being management only. Thanks again. Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 19, 2009 Share Posted March 19, 2009 (edited) Glad to see this UDF! First suggestion: Drop the idea of making changes to Global options in a UDF: Opt("WinTitleMatchMode", 4) If your function really depends on that mode being set, then that function should change it, saving the old value, and restore it before returning. Make a global change that will be left to affect the rest of the script is bad UDF citizenship. In addition, mode 4 methods work by default in the current versions of AutoIt. In addition to the addition, all the UDFs are usually grouped at the top of the script, before any other code, so if the script changes the mode, this line won't help. Edited March 19, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
madplanet Posted March 22, 2009 Share Posted March 22, 2009 (edited) I'm very Happy to See this UDF, because i do not have Microsoft Excel Installed. I used the open and fill cell functions end it worked very well ! Tested with Ooo 2.0 Edited March 22, 2009 by madplanet Link to comment Share on other sites More sharing options...
enaiman Posted March 22, 2009 Share Posted March 22, 2009 I had a look inside the UDF and it covers basic functions ... except a "Save" function and a "Close" one. These 2 functions are all what's missing for a working UDF - looking forward to see them SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted March 22, 2009 Share Posted March 22, 2009 Nice too see automation is possible with Open Office. ..and yeah, enaiman is right about that. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
Leagnus Posted June 19, 2009 Author Share Posted June 19, 2009 (edited) Added _OOoRead2Array() function, that creates an array from specified range of specified worksheet. For searching data this func 8x faster then using _OOoCalc_FindInRange. Thanks to PsaltyDS for note about Opt("WinTitleMatchMode", 4). Edited June 19, 2009 by Leagnus Link to comment Share on other sites More sharing options...
LondonNDIB Posted July 27, 2009 Share Posted July 27, 2009 Even before actually using this, I get this error: C:\Program Files\AutoIt3\Include\OOoCOM_UDF.au3(102,30) : WARNING: $FFile: possibly used before declaration. $cURL = Convert2URL($FFile) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files\AutoIt3\Include\OOoCOM_UDF.au3(102,30) : ERROR: $FFile: undeclared global variable. $cURL = Convert2URL($FFile) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files\AutoIt3\Include\OOoCOM_UDF.au3 - 1 error(s), 1 warning(s) I haven't actually used it in my script... this happens simply after including it. Link to comment Share on other sites More sharing options...
myids Posted February 11, 2010 Share Posted February 11, 2010 I believe you need to edit the UDF file and fix what looks like a typo maybe, about line 93 I think. change it to: Func _OOoCalc_Open($FFile) This change hasn't broken the supplied examples that I have found. If there is no change, I think $FFile needs to be defined in the calling functions and be available from outside the function in the UDF. HTH myids Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 11, 2010 Share Posted February 11, 2010 I believe you need to edit the UDF file and fix what looks like a typo maybe, about line 93 I think. change it to:Func _OOoCalc_Open($FFile)This change hasn't broken the supplied examples that I have found.If there is no change, I think $FFile needs to be defined in the calling functions and be available from outside the function in the UDF.HTHmyidsYou're confused. The parameter variables in a function declaration are used to pass values INTO the function and are automatically declared Local to that function. Look at all the function declarations in the various other UDFs for examples, and review the help file under Func. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ChrisJakarta Posted June 24, 2010 Share Posted June 24, 2010 I've been trying to work with this and similar UDFs to automate OpenOffice, but I'm finding that the setProp function does not seem to work. For example, setting $OpenPar to "ReadOnly" has no effect, and as far as I can determine, the same is true for all parameters set by this function. I have tried essentially the same function in Visual Basic, and it works, so it doesn't seem to be a problem with my installation of Open Office. I have also tried with a much earlier version of AutoIt3, with the same result. I note that at least an earlier version of a similar UDF sets the parameter with: $OpenPar[0] = _ArrayCreate(setProp("ReadOnly", True)) {_ArrayCreate is an apparently depreciated function in the Array UDF). This does not seem to make any difference. What am I missing? I am by no means clear on how these object programming needs are implemented in Autoit, so I'd be grateful for any clarification/ Thanks Chris Link to comment Share on other sites More sharing options...
ChrisJakarta Posted June 25, 2010 Share Posted June 25, 2010 I've done a little more investigation into the problems of passing the parameters. It seems that there is no problem in passing strings (e.g. "Password"); I have not yet tested passing integers. But there is clearly a problem in passing Booleans. If $uValue is passed as True (without quotes), this is passed to MakePropertyValue as a Boolean, but $oPropertyValue.Value remains False; it is not possible to change it to True. If it is passed as "True" (with quotes), it is passed as a string, is stored as a string with value "True', but this has no effect on the result of loadComponentFromURL. I have tried passing the parameter as an integer with value 1 or value 127 (since OO stores Booleans as 2 bytes, with True non-zero), but this still has no effect. I'm running out of ideas.It does not seem passible for this routine to pass a parameter with value True. As I say, VBS has no problem. Anyone offer any help? Chris Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 25, 2010 Share Posted June 25, 2010 (edited) Try integer -1 for 'True', it has worked in some other instances where the exact value of 'True' was an issue when translating VBScript to AutoIt.Edit: Even better answer from Dale Hohm. Edited June 25, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
t0nZ Posted August 31, 2010 Share Posted August 31, 2010 You're confused. The parameter variables in a function declaration are used to pass values INTO the function and are automatically declared Local to that function. Look at all the function declarations in the various other UDFs for examples, and review the help file under Func. By the way I have resolved the warning with $FFile altering the original UDF . I simply have declared the variable in the udf, so Global $FFile Is this a good practise ? And I am a bit confused for determine the last version of OOoCom_udf.au3 . In the developer chat link to thread there is another udf OOo_COM_UDF_v08.au3 named V08. That UDF compiles with no warnings but I am not able to use it (see my post in that thread) , and some funcS are different. I think is time to make order in the OpenOffice's udf. Greetz (and pardon my poor english) Link to comment Share on other sites More sharing options...
benzo Posted September 29, 2010 Share Posted September 29, 2010 hello,First great work and thanks for this marvelous UDF!However i'm very interesting in the following functions :"save as" as in excel_udf, for example:_ExcelBookSaveAs($infos_parc,$fichier_modele, 0, 1,"", "",1, 2)And open a calc document by way invisible_OOoCalc_OpenIs it possible ?help please and sorry for my bad english,i'm french Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now