Jump to content

_Excel_RangeWrite Working partly


Recommended Posts

Hi, This part of function worked really well, but suddenly started to work partly.
I have in $aArray about 116lines and 5 columns and now it writes to excel only 16-62 lines (random line count). 62lines is most i have seen now lately.
_arraydisplay show all data, everything is right in there, if i use filewrite to text file, i get all lines, but in excel i get random line count.
I haven't change anything in code, it worked for some months for now, but suddenly stopped to work

Func _ExportData($aArray)
   Sleep(100)
    Global $oExcel = _Excel_Open(False, False, True, True, True)
    Global $oWorkBook
    If Not FileExists($sDataFilePath) Then
        $oWorkBook = _Excel_BookNew($oExcel)
    Else
        $oWorkBook = _Excel_BookOpen($oExcel, $sDataFilePath)

EndIf
Local $sRange = "a1:f200"
_Excel_RangeDelete($oWorkbook.Activesheet, $sRange)
Sleep(1000)
ConsoleWrite("Deleted Range: " & $sRange & @CRLF)
_Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $aArray)
Sleep(1000)

    If FileExists($sDataFilePath) Then
         _Excel_BookSaveAs($oWorkBook, $sDataFilePath)
    Else
        _Excel_BookSaveAs($oWorkBook, $sDataFilePath)
    EndIf
   _Excel_Close($oExcel, Default, True)
   
    _ArrayDisplay($aArray)
   killEXCEL()
EndFunc   ;==>_ExportData

 

Link to post
Share on other sites

Might be caused by one of the following problems: https://www.autoitscript.com/wiki/Excel_UDF#Excel_RangeWrite_writes_no_data

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

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

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites
14 minutes ago, water said:

Might be caused by one of the following problems: https://www.autoitscript.com/wiki/Excel_UDF#Excel_RangeWrite_writes_no_data

Don´t think so. Cant be memory problems, cos its only 116lines and 5 columns. Cant be character limit, cos characters are 10-30characters per cell. No crashes, just no entry's. aArray has all info visible as it should be. I tested with filewrite and it worked, but i need it to excel as csv not as text >.< last test run inserted only 16 entries instead 116 as array show. Can it be that use consolewrite a lot, like really lot, maybe up to 2000 entries, can it eat away memory for write to excel. Havent tested to turn of consolewrite, cos i actuly need to see that raw data, before they get modified and entered to array

Link to post
Share on other sites

Then it's hard to tell.
Can you please provide example data that shows the described behaviour? So we can play with it?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

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

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites
37 minutes ago, water said:

Then it's hard to tell.
Can you please provide example data that shows the described behaviour? So we can play with it?

Excel output from csv:
Only 16 lines

Price   Stock               Pcode       Delivery    Delivery Date
201.6   In stock            mono-455w   Not Found   Not Found
€259.99   In stock    8X48X72L    €4.50 April 29 - May 4
€1,249.00   We don't know when or if this item will be back   8VNNDD8J    Not Found   Not Found
€160.88   In stock            7RGVKZSD    €9.99 Apr-28
€45.88    In stock            07BNGV9S    €9.99 Apr-28
€22.89    In stock            15FYZ4TC    €9.99 Apr-28
€59.99    In stock            9DCDX6BL    €9.99 Apr-28
€28.49    In stock            83SYCQ3D    €9.99 Apr-28
€51.95    In stock            8YR46RSR    €9.99 Apr-28
€59.99    In stock            9GJNDDP9    €9.99 Apr-28
€26.90    In stock            9FQCN51F    €9.99 Apr-28
€69.99    In stock            99RFLTG8    €9.99 Apr-28
€116.98   Only 19 left In stock   7SFV5VR7    €9.99 Apr-28
€79.85    In stock            7KYM2ZZQ    €9.99 Apr-28
€619.95   In stock            8P3PZ2GZ    €9.95 April 28 - May 2
€1,080.95 In stock                8P3GXPS8    €8.99 April 27 - 29

And in $aArray there's 116 lines like so

 

Link to post
Share on other sites

Please provide the input (as a file) as well.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

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

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...