Jump to content

Recommended Posts

Posted (edited)

Hmm I'm not sure how I'm getting this error, but from what I can tell it appears that having existing calc window(s) open causes the BookAttach to error. It's odd however because I can have both open and perform 1 function that enters and edits 1 sheet while the other is open, then press a button a little later and have another function edit the other sheet while the 1st sheet is open. Essentially both sheets are open the whole time, but waiting a while before editing each doesn't produce the error.

AutoBookKeeping.au3 (183) : ==> COM Error intercepted !
    err.number is:      0x80020009
    err.windescription: Exception occurred.

    err.description is:     com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one.
    err.source is:      [automation bridge] 
    err.helpfile is:    
    err.helpcontext is:     0
    err.lastdllerror is:    0
    err.scriptline is:  183
    err.retcode is:     0x000003E9

My best guess is that the open office COM gets held up if you have 2 open at the same time. Is there a way that I can attach and then detach without closing the sheets? 1 Sheet is really large and takes a long time to load, the other I could close out of each time. However, even leaving the large sheet open and closing out of the faster sheet, still seems to cause that error.

Ugh that feels like a really vague explanation. My car is making funny noises, fix it somehow. Please feel free to ask clarifying questions. I would include code, but isolating it to work for a quick example may not produce the same results and it's sensitive to my moms work. If you, as the dev for this, would like to take a closer look at all the code and spreadsheets involved lemme know. Send me an email in a private message and I'll send it on over.

Edit So running through your code I took

Func _OOoCalc_BookOpen($sFileName, $bHidden = False, $bReadOnly = False, $sPassword = '')
    Local $oOOoCalc_COM_ErrorHandler = ObjEvent("AutoIt.Error", __OOoCalc_ComErrorHandler_InternalFunction)
    #forceref $oOOoCalc_COM_ErrorHandler
    If Not IsString($sFileName) Then Return SetError($_OOoCalcStatus_InvalidDataType, 1, 0)
    If Not FileExists($sFileName) Then Return SetError($_OOoCalcStatus_NoMatch, 1, 0)
    If Not IsBool($bHidden) Then Return SetError($_OOoCalcStatus_InvalidDataType, 2, 0)
    If Not IsBool($bReadOnly) Then Return SetError($_OOoCalcStatus_InvalidDataType, 3, 0)
    If Not IsString($sPassword) Then Return SetError($_OOoCalcStatus_InvalidDataType, 4, 0)
    Local $oSM = ObjCreate("com.sun.star.ServiceManager")
    If Not IsObj($oSM) Then Return SetError($_OOoCalcStatus_GeneralError, 0, 0)
    Local $oDesktop = $oSM.createInstance("com.sun.star.frame.Desktop")
    If Not IsObj($oDesktop) Then Return SetError($_OOoCalcStatus_GeneralError, 0, 0)
    Local $sURL = __OOoCalc_FileToURL($sFileName)
    Local $aoProperties[2] = [__OOoCalc_SetPropertyValue('Hidden', $bHidden)]
    If Not IsObj($aoProperties[0]) Then Return SetError($_OOoCalcStatus_GeneralError, 2, 0)
    $aoProperties[1] = __OOoCalc_SetPropertyValue('ReadOnly', $bReadOnly)
    If Not IsObj($aoProperties[1]) Then Return SetError($_OOoCalcStatus_GeneralError, 3, 0)
    If $sPassword <> '' Then
        ReDim $aoProperties[2]
        $aoProperties[1] = __OOoCalc_SetPropertyValue('Password', $sPassword)
        If Not IsObj($aoProperties[1]) Then Return SetError($_OOoCalcStatus_GeneralError, 4, 0)
    EndIf
    Local $oReturn = $oDesktop.loadComponentFromURL($sURL, '_default', 0, $aoProperties)
    If Not IsObj($oReturn) Then Return SetError($_OOoCalcStatus_GeneralError, 1, 0)
    EndIf
    Return SetError($_OOoCalcStatus_Success, 0, $oReturn)

and added

MsgBox(0,"try",$sURL)
    Local $oReturn = $oDesktop.loadComponentFromURL($sURL, '_default', 0, $aoProperties)
    If Not IsObj($oReturn) Then
        MsgBox(0,"fail",$sURL)
        Return SetError($_OOoCalcStatus_GeneralError, 1, 0)
    EndIf
    Return SetError($_OOoCalcStatus_Success, 0, $oReturn)

a couple msgbox's so I could see what I'm passing into it. First message box for the first spreadsheet gives:

---------------------------
try
---------------------------
file:///C|/Users/Jacob/Desktop/Jake's%20icons/autoit-v3/install/AutoBookKeeping/Notary%20Client%20Verification%20spreadsheet.ods
---------------------------
OK   
---------------------------

Which is the first smaller and faster sheet. Second is:

---------------------------
try
---------------------------
file:///C|/Users/Jacob/Desktop/Connie%202016%20Notary.ods
---------------------------
OK   
---------------------------

Which is the larger slower sheet. Then entering the error reporter:

---------------------------
fail
---------------------------
file:///C|/Users/Jacob/Desktop/Connie%202016%20Notary.ods
---------------------------
OK   
---------------------------

Which I've pretty well concluded that this information is useless. I assume that "file:///C|" is valid since it works for the first sheet. Maybe the ' in Jake's Icons is causing an error... brb hmm nope... Got to somehow be about an amount of time in between opening and closing sheets with the COM. Any help would be greatly appreciated.

It appears that perhaps https://www.openoffice.org/api/docs/common/ref/com/sun/star/frame/FrameSearchFlag.html Auto is not supported anymore. Ie:

Local $oReturn = $oDesktop.loadComponentFromURL($sURL, '_default', 0, $aoProperties)

Should be:

Local $oReturn = $oDesktop.loadComponentFromURL($sURL, '_default', 55, $aoProperties)

I could very easily be barking up the wrong tree though. Brb I'm going to test that. Nope.

Edited by keafter
Posted

Hi, thanks für the udf, it opens up many possibilities.

I want to use the udf togehter with a portable version of libreoffice. Is there a way to tell the udf, where the path of libreoffice is?

 

Posted (edited)

@keafter: Are you saying that if multiple sheets are open, you can attach to one, but not the other?  I don't know if this would help, but would populating data from one book to an array eliminate the need to keep both open, or are you editing both at the same time? If it's possible to create a simple reproducer, that might help.

Edit: Are you able to open each of those files individually without the other open?  I'm trying to troubleshoot all options here.  Maybe one of the files opens, but not the other, which could point to a problem with __OOoCalc_FileToURL or my loadComponentFromURL command(s).

@rollo5: I'm not sure if this would work with the portable version, since it uses UNO/COM.

The objects that this UDF uses are as follows:
com.sun.star.ServiceManager
com.sun.star.frame.Desktop
com.sun.star.text.TextField.URL

Anyone else can feel free to correct me if I'm wrong, but I believe that if those aren't in your registry, this UDF is a "no go."

Edited by GMK
Addendum
Posted (edited)

Hey lucky me! I remembered that I had a file made that excludes sensitive info. Please inform me if this zip contains any sensitive info... shouldn't

So the script is AutoBookKeeping.au3

1st. Open both Job database.ods and Notary Client Verification.ods

2nd. Run the AutoBookKeeping script. Will probably need firefox so it doesn't kill over.

3rd. Click OK and watch for errors. It will start by editing Notary Client Verification.ods then close and print that, then open firefox for directions, then edit Job database. It errors opening/attaching to job database.ods

Optional 4th. Button labeled Just print Notary Client verification will just edit the first spreadsheet. Button labeled Just update Spreadsheet will edit job database.ods 

The function that edits Notary Client Verification.ods is called NCV() which starts on line 321 The other is Signings() which starts on 382.

You press one button and then wait and press the other and it works, but for some reason it doesn't like doing both immediately side by side. Comment or uncomment line 362 to keep it from closing  or close the Notary Client Verification.ods. Comment or uncomment line 438 for the Job database.ods.

It's pretty messy code... I'll do some house cleaning and optimizing eventually lol.

Testing.zip

Edited by keafter
Posted (edited)

@GMK

Dang actually that wasn't it. I also tried changing it to  _OOoCalc_BookSaveAs($openofficecalcwindow, $NCVFolderToSave & $NCVFileName, Default, True)

but that didn't work either.

AutoBookKeeping.au3 (183) : ==> COM Error intercepted !
    err.number is:      0x80020009
    err.windescription: Exception occurred.

    err.description is:     com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one.
    err.source is:      [automation bridge] 
    err.helpfile is:    
    err.helpcontext is:     0
    err.lastdllerror is:    0
    err.scriptline is:  183
    err.retcode is:     0x000003E9

Edit: I think my error is while trying to attach to the already open file and then when it fails to attach to the file it tries to open the already open file.

$OoCalcWindow2 = _OOoCalc_BookAttach($ReportSpreadsheetFile)
If @error Then
    $OoCalcWindow2 = _OOoCalc_BookOpen($ReportSpreadsheetFile)
EndIf

Sure enough so in your _OOoCalc_BookAttach at the bottom I've done this:

Local $sWinTitle = WinGetTitle('[CLASS:SALFRAME]')
    MsgBox(0,"title is",$sWinTitle)
    Local $asTempTitle = StringRegExp($sWinTitle, '(.*?\.[A-z]{3}).*', 1)
    MsgBox(0,"title is",$asTempTitle[0])
    If Not @error Then $sWinTitle = $asTempTitle[0]
    If Not StringInStr($sWinTitle, $sFileName) Then
        MsgBox(0,"error","File not same as filename")
        MsgBox(0,"",$sWinTitle & " " & $sFileName)
        Return SetError($_OOoCalcStatus_NoMatch, 0, 0)
    EndIf
    Local $oReturn = $oDesktop.getCurrentComponent
    If Not IsObj($oReturn) Then Return SetError($_OOoCalcStatus_GeneralError, 0, 0)
    Return SetError($_OOoCalcStatus_Success, 0, $oReturn)
EndFunc   ;==>_OOoCalc_BookAttach

The "If Not StringInStr" is coming up true even though the MsgBox(0,"",$sWinTitle & " " & $sFileName) gives:

---------------------------

---------------------------
Connie 2016 Notary.ods C:\Users\Jacob\Desktop\Connie 2016 Notary.ods
---------------------------
OK   
---------------------------

That string is however in that string. So why does it error?

I swapped stringinstr around so it's: StringInStr($sFileName, $sWinTitle) and I get passed that error. However it's still erroring on:

If Not IsObj($oReturn) Then Return SetError($_OOoCalcStatus_GeneralError, 0, 0)

This actually leaves me at the point where I can either have both closed or both open and it still detects both as objects while opening or attaching. This is partially solved, but, for some reason if I have 1 open and 1 closed it doesn't detect the 1 open as an object. I imagine that most of the time 1 will be left open when she runs this script which wouldn't be good.

Hmm I also have to send just the filename through the attach function instead of the full file path and filename or it produces similar errors:

_OOoCalc_BookAttach("Notary Client Verification spreadsheet.ods")
Instead of
_OOoCalc_BookAttach("C:/Users/Jacob/Desktop/Notary Client Verification spreadsheet.ods")

 

Edited by keafter
  • 2 months later...
Posted

Hey it's me again! It's legitimately taken me this long to decide to revisit this. I have finally gotten around to making my Mom's spreadsheet easily sortable without botching up existing formulas. (For those curious, I'll add how at the bottom of this) 

Ultimately I'm trying to make my spreadsheet usable by the average joe, by including an autoit script to manage the quirks.

So for the record @GMK I already love you forever for helping figure out the double spreadsheet problem I was having. I would love you forever x2 if you managed to get the _OOoCalc_RangeSort working. :D (Thought that I would say that it would be useful to someone :) )

 

Making a spreadsheet sortable without messing up formulas can be a pain in open office at times. You may want to sort a table of info, but your formulas seem to still calculate where they were prior to sorting. This isn't good because then you have to go back and fix all the effected formulas. Luckily in my case all of the formulas follow row numbers:

=IF($Signings.$K6>0;$Signings.$J6;"")
=IF($Signings.$K7>0;$Signings.$J7;"")
=IF($Signings.$K8>0;$Signings.$J8;"")
etc.

Essentially to make the formulas sort properly without becoming jumbled you just make all of the formulas the same. How would you do such things and still keep info? Simple:

=INDIRECT("$'Formulas Configurations'.$C" & ROW())

On a separate sheet match up the rows exactly and put your list of formulas on that sheet. Then call the value of the cell from the other sheet with the row number of the sheet you want to sort. Finangling! 

 

So essentially because it has been set up this way, I can sort all day long without fearing my formulas getting jumbled. This means that I could actually make the _OOoCalc_RangeSort work in a much safer manner, perfect even for testing. :) 

This was written up quickly and with a foggy brain, so if it doesn't make much sense, I totally understand and I'll try to clarify as needed.

  • 3 weeks later...
Posted

Hi @keafter,

Sorry it's taken me so long to get back on here.  Unfortunately, I have not found the best way to get the sort to work.  I haven't looked at it in a while, but perhaps I can find something after taking a (long) break from it.  If I do get it working, I'll be sure to post an updated version here.  If anyone else finds the secret to sorting in OpenOffice/LibreOffice using UNO, please let me know!

Posted (edited)

GMK please use ByRef here:
 

__OOoCalc_ComErrorHandler_InternalFunction(ByRef $oCOMError)

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted

if you are using "changed" functions from other UDF  please make function names more unique.

;__DateTimeSplit
;__DateIsValid
;__DaysInMonth
;__DateIsLeapYear

for example change them to:

;__OOoCalc__DateTimeSplit
;__OOoCalc__DateIsValid
;__OOoCalc__DaysInMonth
;__OOoCalc__DateIsLeapYear

as this is quite possible that another developer do the same, and will be a FunctionName conflict.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted (edited)

In relation to : _OOoCalc_RangeSort()

I found this example:

https://wiki.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Sorting

 // --- sort by second column, ascending ---
 
  // define the fields to sort
  com.sun.star.util.SortField[] aSortFields = new com.sun.star.table.TableSortField[1];
  aSortFields[0] = new com.sun.star.table.TableSortField();
  aSortFields[0].Field = 1;
  aSortFields[0].IsAscending = true;
  aSortFields[0].IsCaseSensitive = false;
 
  // define the sort descriptor
  com.sun.star.beans.PropertyValue[] aSortDesc = new com.sun.star.beans.PropertyValue[2];
  aSortDesc[0] = new com.sun.star.beans.PropertyValue();
  aSortDesc[0].Name = "SortFields";
  aSortDesc[0].Value = aSortFields;
  aSortDesc[1] = new com.sun.star.beans.PropertyValue();
  aSortDesc[1].Name = "ContainsHeader";
  aSortDesc[1].Value = new Boolean(true);
 
  // perform the sorting
  com.sun.star.util.XSortable xSort = (com.sun.star.util.XSortable)
      UnoRuntime.queryInterface(com.sun.star.util.XSortable.class, xRange);
  xSort.sort(aSortDesc);

I think you are properly define field to sort, and sort descriptor.
But I do not see how you are using this implementation:

  // perform the sorting
  com.sun.star.util.XSortable xSort = (com.sun.star.util.XSortable)
      UnoRuntime.queryInterface(com.sun.star.util.XSortable.class, xRange);
  xSort.sort(aSortDesc);

but for the other look here:

https://wiki.openoffice.org/wiki/Documentation/OOo3_User_Guides/Calc_Guide/Sorting

Sub SortRange
  Dim oSheet        ' Calc sheet containing data to sort.
  Dim oCellRange    ' Data range to sort.
 
  REM An array of sort fields determines the columns that are
  REM sorted. This is an array with two elements, 0 and 1.
  REM To sort on only one column, use:
  REM Dim oSortFields(0) As New com.sun.star.util.SortField
  Dim oSortFields(1) As New com.sun.star.util.SortField
 
  REM The sort descriptor is an array of properties.
  REM The primary property contains the sort fields.
  Dim oSortDesc(0) As New com.sun.star.beans.PropertyValue
 
  REM Get the sheet named "Sheet1"
  oSheet = ThisComponent.Sheets.getByName("Sheet1")
 
  REM Get the cell range to sort
  oCellRange = oSheet.getCellRangeByName("A1:C5")
 
  REM Select the range to sort.
  REM The only purpose would be to emphasize the sorted data.
  'ThisComponent.getCurrentController.select(oCellRange)
 
  REM The columns are numbered starting with 0, so
  REM column A is 0, column B is 1, etc.
  REM Sort column B (column 1) descending.
  oSortFields(0).Field = 1
  oSortFields(0).SortAscending = FALSE
 
  REM If column B has two cells with the same value,
  REM then use column A ascending to decide the order.
  oSortFields(1).Field = 0
  oSortFields(1).SortAscending = True
 
  REM Setup the sort descriptor.
  oSortDesc(0).Name = "SortFields"
  oSortDesc(0).Value = oSortFields()
 
  REM Sort the range.
  oCellRange.Sort(oSortDesc())
End Sub 

 

It looks good, so currently I cant find solution for this sorting issue.

 


here is my proposal for:

Func __OOoCalc_WorksheetIsValid($oObj, $vSheet)
    Local $oOOoCalc_COM_ErrorHandler = ObjEvent("AutoIt.Error", __OOoCalc_ComErrorHandler_InternalFunction)
    #forceref $oOOoCalc_COM_ErrorHandler
    If Not IsObj($oObj) Then Return SetError($_OOoCalcStatus_GeneralError, 0, 0)
    If IsInt($vSheet) Then
        If $vSheet >= 0 And $vSheet <= $oObj.getSheets.count - 1 Then Return SetError($_OOoCalcStatus_Success, 0, True)
        Return SetError($_OOoCalcStatus_NoMatch, 0, False)
    ElseIf IsString($vSheet) And $vSheet <> '' Then
        Local $asWorksheets = _OOoCalc_SheetList($oObj)
        For $iSheet = 1 To $asWorksheets[0]
            If $asWorksheets[$iSheet] == $vSheet Then Return SetError($_OOoCalcStatus_Success, 0, True)
        Next
        Return SetError($_OOoCalcStatus_NoMatch, 0, False)
    EndIf
    Return SetError($_OOoCalcStatus_InvalidDataType, 0, False)
EndFunc   ;==>__OOoCalc_WorksheetIsValid

Remark 1: you do not need to declare $iSheet as this is done autmaticaly by For Next Loop

Remark 2: you can start using Scoping for $asWokrsheets (can be declared only when IsString .... )

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted

OK, newest version uploaded, including a sort fix!  Please test and let me know how it works or how I can make it better!

Posted

I notice that this part:
 

; Don't understand why the sort is not working
For $iCounter = 2 To 6
    _OOoCalc_RangeSort($oCalc, "CALC", "B3:F6", $iCounter, True, True)
    MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, $sTitle, "B3:F6 Sorted by column " & Chr($iCounter + 64) & " (ascending)...")
Next

Currently works well :)

Tested on Apache OpenOffice 4.1.1

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted

Constants:

Global Enum _ ; @Extended Status Types
        $0CALC_EXT_DEFAULT, _
        $0CALC_EXT_PARAM1, _
        $0CALC_EXT_PARAM2, _
        $0CALC_EXT_PARAM3, _
        $0CALC_EXT_PARAM4, _
        $0CALC_EXT_PARAM5, _
        $0CALC_EXT_COUNTER

and small fix and refactoring

Func __OOoCalc_WorksheetIsValid($oObj, $vSheet)
    Local $oOOoCalc_COM_ErrorHandler = ObjEvent("AutoIt.Error", __OOoCalc_ComErrorHandler_InternalFunction)
    #forceref $oOOoCalc_COM_ErrorHandler
    If Not IsObj($oObj) Then Return SetError($_OOoCalcStatus_InvalidDataType, $0CALC_EXT_PARAM1, 0)
    If IsInt($vSheet) Then
        If $vSheet >= 0 And $vSheet <= $oObj.getSheets.count - 1 Then Return SetError($_OOoCalcStatus_Success, $0CALC_EXT_DEFAULT, True)
        Return SetError($_OOoCalcStatus_NoMatch, $0CALC_EXT_PARAM2, False)
    ElseIf IsString($vSheet) And $vSheet <> '' Then
        Local $asWorksheets = _OOoCalc_SheetList($oObj)
        For $iSheet = 1 To $asWorksheets[0]
            If $asWorksheets[$iSheet] == $vSheet Then Return SetError($_OOoCalcStatus_Success, $0CALC_EXT_DEFAULT, True)
        Next
        Return SetError($_OOoCalcStatus_NoMatch, $0CALC_EXT_PARAM2, False)
    EndIf
    Return SetError($_OOoCalcStatus_InvalidDataType, $0CALC_EXT_PARAM2, False)
EndFunc   ;==>__OOoCalc_WorksheetIsValid

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted (edited)

all:

If Not IsObj($oObj) Then Return SetError($_OOoCalcStatus_GeneralError, 0, 0)

should be in most cases changed to:

If Not IsObj($oObj) Then Return SetError($_OOoCalcStatus_InvalidDataType, $0CALC_EXT_PARAM1, 0)

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted

some refactoring:

Func __OOoCalc_CellRCToA1($iRow, $iCol)
    Local $iQuotient = Int($iCol / 26)
    Local $iRemainder = Mod($iCol, 26)
    Local $sChar = Chr(65 + $iRemainder)
    If $iQuotient <> 0 Then $sChar = Chr(65 + $iQuotient) & $sChar
    Return $sChar & String($iRow + 1)
EndFunc   ;==>__OOoCalc_CellRCToA1

 

WEnd
    If $bFlag Then Return SetError($_OOoCalcStatus_InvalidValue, 2, 0)
    
    $oObj.Sheets.insertNewByName($sSheet, $iPos)
    Return SetError($_OOoCalcStatus_Success, 0, 1)
EndFunc   ;==>_OOoCalc_SheetAddNew

 

 


in _OOoCalc_RowDelete and in _OOoCalc_RowInsert

You are using bad approach:

If $iRow < 0 Then $iRow = 0

it should be:

If $iRow < 0 Then Return SetError($_OOoCalcStatus_InvalidValue, 2, 0)

for example:

Func _OOoCalc_RowInsert($oObj, $iRow, $iNumRows = 1, $vSheet = -1)
    Local $oOOoCalc_COM_ErrorHandler = ObjEvent("AutoIt.Error", __OOoCalc_ComErrorHandler_InternalFunction)
    #forceref $oOOoCalc_COM_ErrorHandler
    If Not IsObj($oObj) Then Return SetError($_OOoCalcStatus_InvalidDataType, 1, 0)
    If Not IsInt($iRow) Then Return SetError($_OOoCalcStatus_InvalidDataType, 2, 0)
    If $iRow < 0 Then Return SetError($_OOoCalcStatus_InvalidValue, 2, 0)
    If Not IsInt($iNumRows) Then Return SetError($_OOoCalcStatus_InvalidDataType, 3, 0)
    If Not IsInt($vSheet) And Not IsString($vSheet) Then Return SetError($_OOoCalcStatus_InvalidDataType, 4, 0)
    If $vSheet > -1 And Not __OOoCalc_WorksheetIsValid($oObj, $vSheet) Then Return SetError($_OOoCalcStatus_NoMatch, 4, 0)
    Local $oSheet = __OOoCalc_GetSheet($oObj, $vSheet)
    If Not IsObj($oSheet) Then Return SetError($_OOoCalcStatus_GeneralError, 0, 0)
    $oSheet.getRows.insertByIndex($iRow, $iNumRows)
    Return SetError($_OOoCalcStatus_Success, 0, 1)
EndFunc   ;==>_OOoCalc_RowInsert

 

and the same approach with :

If $iCol < 0 Then $iCol = 0

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Posted
14 hours ago, mLipok said:

I notice that this part:
 

; Don't understand why the sort is not working
For $iCounter = 2 To 6
    _OOoCalc_RangeSort($oCalc, "CALC", "B3:F6", $iCounter, True, True)
    MsgBox($MB_ICONINFORMATION + $MB_TOPMOST, $sTitle, "B3:F6 Sorted by column " & Chr($iCounter + 64) & " (ascending)...")
Next

Currently works well :)

Tested on Apache OpenOffice 4.1.1

 

Right. Forgot to remove that comment. Fixed now.

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
×
×
  • Create New...