Jump to content

Update the Excel UDF that comes with AutoIt


water
 Share

Recommended Posts

@@ DEBUG COM Error encountered in Test.au3 (1230) :
    Number          = 0x80020009 (-2147352567)
    WinDescription  = Exception occurred.
    Description     = Invalid number of arguments.
    Source          = Microsoft Excel
    HelpFile        = xlmain11.chm
    HelpContext     = 0
    LastDllError    = 0
    Retcode         = 0x800A03EC

Link to comment
Share on other sites

Which version of Excel do you run?

Did you use Beta 4 or Beta 5 for the last test?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

i have tested on excel 2010 and 2013 with excel rewrite beta 4, beta 5 and even the latest autoit version which should already have the latest excel udf. All of them give me the same result.

Edited by lolipop
Link to comment
Share on other sites

Very strange :unsure:

Will test next week as soon as I return to my office.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I hate MS! That is information that should be found on MSDN in the Excel reference.

I will do some tests myself but I fear that your findings are correct and there is no way to get the text for more than a songle cell.

In this case the UDF docu needs to be enhanced.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I just played with Excel 2010 and got the same result. You can access value and formula for a range > 1 cell. Text only allows one cell.

So I need to modify the function and enhance the documentation.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Thanks for the confirmation. Sad to hear that. Do you know of any other ways to read multiple cell for displayed text? My whole excel data are mostly date and time. Else I would need to rewrite my whole excel date with text format.That's a pain in the ass.

Link to comment
Share on other sites

I don't know of another way to read the text property of a larger range. You could do it in a loop and read cell by cell. But that would be much slower.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

i have a large Array with 12 columns and 23.000 rows.

When i try to Write the entire Array into an empty Excel Sheet nothing happens.

When i try my code on a smaller scale everything works fine.

#include <Array.au3>
#include <Excel.au3>
Local $Appl_Excel = _Excel_Open(1)                                                                                                                      ;1 = visible
Local $Var_Exceltabelle_Testspezifikation = (@ScriptDir & "\Template_Testspezifikation.xlsx")                               ;initialise
Local $Obj_Excel_Testspezifikation = _Excel_BookOpen($Appl_Excel, $Var_Exceltabelle_Testspezifikation, 0, 1)                        ;read+write+visible
Local $Array_Testspezifikation[2][12] = [["1","2","3"],["4","5"& @CRLF & "5.5","6"]]

_Excel_RangeWrite($Obj_Excel_Testspezifikation, Default , $Array_Testspezifikation)
_Excel_BookSaveAs ( $Obj_Excel_Testspezifikation, @ScriptDir & "\Testspezifikation.xlsx", $xlWorkbookDefault, True)

In this small scale everything works fine, but the exact same code with a 23.000 row array and nothing is written to the Excel Sheet.

When i try to look at my Array with _ArrayDisplay($Array_Testspezifikation) the Array looks just fine like i want it.

Can someone tell me why this is not working on a larger scale?

Edited by illostos
Link to comment
Share on other sites

You need to add some error checking to your script.

What is the value of @error and @extended after you called _Excel_RangeWrite?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

You need to add some error checking to your script.

What is the value of @error and @extended after you called _Excel_RangeWrite?

Hmm i have error checking :)

There are no errors. When i write the Array into the Excel Sheet "" is written.

I tried this with an Excel Sheet with data already in it. The Data is Overwritten with "".

Before _Excel_RangeWrite there is something in my Excel Sheet.

After _Excel_RangeWrite nothing is in my Excel Sheet.

But the Array i write into the Sheet is there, i see it with _ArrayDisplay. It can be displayed but it is not written into the Sheet.

Link to comment
Share on other sites

Ok, but what is the value of @error and @extended after you called _Excel_RangeWrite?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Which version of AutoIt do you run?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Which version of AutoIt do you run?

v3.3.12.0

PS: I tested something:

When i tried to Write my Array into a Textfile it works perfectly:

$sFilePath = @ScriptDir & "\Test.txt"
Local $Var_Test = FileOpen($sFilePath, 2)
_FileWriteFromArray($Var_Test, $Array_Testspezifikation)
FileClose($Var_Test)

But writing this to an Excel File doesn't work. Why?

Edit: OK i found the error. My Array was more than 255 characters which i didn't realised ... with the $bForceFunc=True it worked. Thanks for the fast support :)

Edited by illostos
Link to comment
Share on other sites

I noticed that your data contains @CRLF.

I tested with the following script and it works just fine. Could you please test and post the result?

#include <Array.au3>
#include <Excel.au3>
Local $Appl_Excel = _Excel_Open(1)
Local $Var_Exceltabelle_Testspezifikation = (@ScriptDir & "\Template_Testspezifikation.xlsx")
Local $Obj_Excel_Testspezifikation = _Excel_BookNew($Appl_Excel)
Local $Array_Testspezifikation[26000][12] = [["1", "2", "3"],["4", "5" & @CRLF & "5.5", "6"]]
For $i = 0 To UBound($Array_Testspezifikation, 1) - 1
    $Array_Testspezifikation[$i][0] = $i + 1
    $Array_Testspezifikation[$i][1] = $i + 2 & @CRLF & $i + 2.5
    $Array_Testspezifikation[$i][2] = $i + 3
    $Array_Testspezifikation[$i][3] = $i + 4
    $Array_Testspezifikation[$i][4] = $i + 5
Next
_Excel_RangeWrite($Obj_Excel_Testspezifikation, Default, $Array_Testspezifikation)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 2 weeks later...

Missing very usefull/required  argument "TextToDisplay" of UDF "_Excel_RangeLinkAddRemove"

Is there any reason not implement this argument?

To add an significant short meaningfull content to the cell instead of very long URL.

Solution simple, only addconditional Argument.

Link to comment
Share on other sites

Seems I missed that. Will be added to the next Beta version of AutoIt.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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

×
×
  • Create New...