Safehaven Posted August 10, 2010 Share Posted August 10, 2010 Hi Everyone, I recently started using AutoIt for some development project and I've found & enhanced the OOoCOM_UDF.au3 file to work in a way that is compatible with the standard excel library. modified entries include: _OOoCalc_SheetList _OOoCalc_SheetActivate _OOoCalc_ReadCell _OOoCalc_WriteCell UsedRange The listed functions are now interchangeable between Microsoft Office (Excel) and Open Office (Calc). I've also improved the working of these functions to call the "correct" API's. In my search I've found that the OpenOffice site: http://api.openoffice.org/ was very useful. Please report back with your findings. All the best,OOoCOM_UDF_v08.au3 mLipok 1 Link to comment Share on other sites More sharing options...
AndyG Posted August 10, 2010 Share Posted August 10, 2010 Hi, i have written some OOCalc-Functions two Years ago. An example of the used functions and the collection of these functions is available here: oocalc_4.au3. Feel free to put anything useful into your UDF! Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 10, 2010 Share Posted August 10, 2010 (edited) I recently started using AutoIt for some development project and I've found & enhanced the OOoCOM_UDF.au3 file to work in a way that is compatible with the standard excel library. modified entries include: _OOoCalc_SheetList _OOoCalc_SheetActivate _OOoCalc_ReadCell _OOoCalc_WriteCell UsedRange I see a lot of comments like this: Func _OOoCalc_Attach($fn) Dim $oSM Local $oDesktop, $f_num $oSM = ObjCreate("com.sun.star.ServiceManager") $oDesktop = $oSM.createInstance("com.sun.star.frame.Desktop") ; Create a desktop object: ; êîë-âî îêîí, íå ïîäõîäèò òîëüêî äëÿ öèêëà ïåðåáîðà îêîí: íå îòñëåæèâàåòñÿ Extension Manager: $f_num = $oDesktop.Frames.Count ; number of frames opened for documents or developing ; If few documents are open If $f_num > 1 Then ; åñëè íåñêîëüêî îêîí – ñäåëàåì àêòèâíûì íóæíîå Are you working in an alternate encoding/code page or something? Edited August 10, 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...
Zedna Posted August 14, 2010 Share Posted August 14, 2010 I think this should be in Examples section. Some moderator can move it there if you ask for it... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
t0nZ Posted August 29, 2010 Share Posted August 29, 2010 Hi , I have used the OOoCom_udf.au3 for some months with few problems. Now I was writing a program to transform "any" calc sheet in a sqlLite table. It can get a sheet where records are rows and it takes the columns of first row as field names in sqlLite The program is nearly finished, but i have to "tag" the end of the first row with a particular value, or _OOoCalc_ReadCell goes in error First problem. So I downloaded your UDF, but I have another error: I receive this error (in the UDF) : C:\Program Files (x86)\AutoIt3\Include\OOoCOM_UDF.au3 (234) : ==> The requested action with this object has failed.: $SheetComponent = $Sheets.GetByName($Worksheet) $SheetComponent = $Sheets.GetByName($Worksheet)^ ERROR This when I use _OOoCalc_ReadCell. Code: $oCurCom = _OOoCalc_Open($FFile) While 1 ; cycle for column names --> database table names $tmpcolumn = _OOoCalc_ReadCell($oCurCom, 0, $row, $column) ; first lap for column names of database table Why ? By the way thanx to all the contributors of this OpenOffice UDF. Link to comment Share on other sites More sharing options...
Safehaven Posted December 9, 2010 Author Share Posted December 9, 2010 I see a lot of comments like this: Func _OOoCalc_Attach($fn) Dim $oSM Local $oDesktop, $f_num $oSM = ObjCreate("com.sun.star.ServiceManager") $oDesktop = $oSM.createInstance("com.sun.star.frame.Desktop") ; Create a desktop object: ; êîë-âî îêîí, íå ïîäõîäèò òîëüêî äëÿ öèêëà ïåðåáîðà îêîí: íå îòñëåæèâàåòñÿ Extension Manager: $f_num = $oDesktop.Frames.Count ; number of frames opened for documents or developing ; If few documents are open If $f_num > 1 Then ; åñëè íåñêîëüêî îêîí – ñäåëàåì àêòèâíûì íóæíîå Are you working in an alternate encoding/code page or something? I've noticed this as well, luckily this is only the case for the comments, which leads me to believe the original author of the UDF was working with a different signs than the "std" ascii set. Link to comment Share on other sites More sharing options...
bob2 Posted October 29, 2011 Share Posted October 29, 2011 Hi, I found the functions of ooocalc_4.au3 very interesting, but I have a problem to open a file with: _OOOpenBook ($ fname):$ fname = @ ScriptDir & "\ Temp1.ods" _OOOpenBook ($ Fname)This gives me an error: ==> Missing right bracket ')' in expression.:$ = $ odoc oDesk.loadComponentFromURL ($ fname, "_blank", 0, $ OpenPar)$ = ^ ERROR odocCan anyone give me an example of use? In advance, thank you. Link to comment Share on other sites More sharing options...
BrewManNH Posted October 29, 2011 Share Posted October 29, 2011 If what you posted is part of your real script, you have a space after every $ and before the variable name, that is not going to work right. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
bob2 Posted October 29, 2011 Share Posted October 29, 2011 Thank you, but no, I have no space after (that is making a copy and paste into the Google translator as spaces began) : The requested action with this object has failed.: $oCurCom = $oDesktop.loadComponentFromURL( $cURL, "_blank", 0, $OpenPar) $oCurCom = $oDesktop.loadComponentFromURL( $cURL, "_blank", 0, $OpenPar)^ ERROR Link to comment Share on other sites More sharing options...
gmmg Posted March 21, 2012 Share Posted March 21, 2012 (edited) Hello,I used this OOoCOM_UDF today Here is my Solution to delete a sheet by name!_OOBookDeleteSheet("Tabelle1") ;_OOBookDeleteSheet("sheet1") Func _OOBookDeleteSheet($sheetname) ;Delete other Sheets (by default Sheet2,Sheet3) $errormodul = "_OODeleteSheet" If $odoc.Sheets.hasByName($sheetname) Then $odoc.Sheets.removeByName($sheetname) EndFunc ;==>_OOBookDeleteSheetgmmg Edited March 21, 2012 by gmmg 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