Jump to content
Sign in to follow this  
JamesDover

Excel.au3 Issues in Version 3.4.4

Recommended Posts

JamesDover

I am using the version of Excel.au3 that came with auto-it but it says undefined function when I try to run it. Here is the code.

Thanks  :bye:

Local $oExcel = _ExcelBookNew() ===================SHOWS undefinded function
            _ExcelWriteSheetFromArray($oExcel, $Model1, 1, 1, 0, 0) ===================SHOWS undefinded function

Share this post


Link to post
Share on other sites
BrewManNH

The Excel UDF has been totally rewritten, including renaming of the functions.


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 Gude
How 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

Share this post


Link to post
Share on other sites
JamesDover

Thanks 

Share this post


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
Sign in to follow this  

  • Similar Content

    • chaddro
      By chaddro
      First post, be gentle
      I am working on a script that will eventually run via a batch file with Task Scheduler. 
      The purpose of the script is to query SQL Server and save the results as .xlsx files.  However, when I run the script either from the editor or compiled file, the excel windows open and I have to close them for the script to continue. I did not have this issue initially, the excel windows would open and then close on their own.
      Below is code from one section of the script where I am creating my spreadsheets. This code creates a single spreadsheet with a list of invoices for that day:
      ; Query SQL Server for List of Invoices dated $aDocumentDate $iReturnVal1 = _SQL_GetTable2D(-1,$aQuery,$aData,$iRows,$iColumns) If $iReturnVal1 = $SQL_OK Then ; Display Query Results in Array ; _arrayDisplay($aData,"2D (" & $iRows & " Rows) (" & $iColumns & " Columns)" ) ; Create Excel file name based on date of query $excelFileNameList1 = "C:\pride\daily\invoices_" & $aDocumentDate & ".xlsx" ; Open Existing or Create .xlsx file Local $oExcel_1 = _Excel_Open(False) Local $oWorkbook = _Excel_BookNew($oExcel_1, 1) ; Write Query results to Excel Spreadsheet and save _Excel_RangeWrite($oWorkbook,Default, $aData, "A1", True, True) _Excel_BookSaveAs($oWorkbook, $excelFileNameList1, Default, True) ; Close the book and close Excel handle _Excel_BookClose($oWorkbook, True) _Excel_Close($oExcel_1) EndIf This code then creates a separate spreadsheet for each invoice and saves:
      ;============[ $aData holds list of Invoices Local $aInvoiceNumber ; Invoice Number for Query Local $aData2, $iRows2, $iColumns2 ; Read Query from file to save space here.... WORKING ... query must all be on one line! Local $aQueryFromFile = FileRead("c:\pride\invoice.sql",FileGetSize("c:\pride\invoice.sql")) Local $aQuery2 For $i = 1 to $iRows $aInvoiceNumber = $aData[$i][0] ; invoice number to query $aQuery2 = $aQueryFromFile & $aInvoiceNumber & ";" ; Display query to console ; ConsoleWrite(@lf & $aQuery2 & @lf) ; Get Invoice Data $iReturnVal2 = _SQL_GetTable2D(-1,$aQuery2,$aData2,$iRows2,$iColumns2) If $iReturnVal2 = $SQL_OK Then ; show query result ;_arrayDisplay($aData2,"2D (" & $iRows2 & " Rows) (" & $iColumns2 & " Columns)" ) ; check invoice file name ;ConsoleWrite(@LF & "Data for invoice: " & $aInvoiceNumber & @LF) ; Create file name for invoice spreadsheet $excelFileName2 = "C:\pride\invoices\invoice_" & $aInvoiceNumber & ".xlsx" ; Open Existing or Create .xlsx file Local $oExcel_2 = _Excel_Open(False) ; create excel instancee Local $oWorkbook2 = _Excel_BookNew($oExcel_2, 1) ; Create new workbook with 1 sheet ; Write query results to Excel Sheet ; Note: we must use $bforceFunc TRUE to bypass Excel Limitations _Excel_RangeWrite($oWorkbook2, $oWorkbook2.Activesheet, $aData2, "A1", True, True) If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite ", "Error writing to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel_2) Exit EndIf _Excel_BookSaveAs($oWorkbook2, $excelFileName2, Default, True) _Excel_BookClose($oWorkbook2, True) _Excel_Close($oExcel_2) EndIf Next One thing to note: I am using $bForceFunc = True in _Excel_RangeWrite because I may have strings longer than 255 character. Also, I am using Office 2010 if that matters. I am also compiling for command line.
      Pardon the diagnostic code, this is my first autoit script
      Thank you in advance for your help!
    • Skeletor
      By Skeletor
      Hi Guys,
      Can anyone point me in the right direction. I'm trying to accomplished conditional formatting with arrows, but the code I have is wrong... 
      .Range("=$A3:$A4000").FormatConditions.Add = (xlCellValue, xlGreater, "=$A:$A") .IconSet(xl3Arrows) ;ActiveWorkbook.iconsets I also tried it like this:
      .Range("=$A3:$A4000").FormatConditions _ .Add(xlCellValue, xlGreater, "=$A:$A") .IconSet(xl3Arrows) ;ActiveWorkbook.iconsets  
    • Skeletor
      By Skeletor
      Hi Guys,
      How would you use _Excel_FilterSet to filter the excel sheet from largest number to smallest number?
      _Excel_FilterSet($oWorkbook, "Sheet1", "A2:I2", 1, ">20", 1, "<40") ; OR _Excel_FilterSet($oWorkbook, "Sheet1", "A2:I2", 1, ">", 1, "<") Excel Sheet attached. Trying to filter on the last column "I2"
      Inventory.xlsx
    • Skeletor
      By Skeletor
      Hi All,
      Has anyone come across this before?
      Code below:
      $SheetList = _Excel_SheetList($oWorkbook) _FileWriteFromArray("C:\" & $SheetListOutput, $SheetList, 1) Result:
      ResultABC| ResultDEF| ResultGHI| ResultJKL| ResultMNO| It created these "|" vertical bars?
    • Skeletor
      By Skeletor
      Hi All,

      I would like to know how you would take a FileLineRead and insert it into an array which then inserts it into Excel?
      One thing to know is the files content is broken up, so I only use half of the content within $FileRead1.
      So its imperative that the $value1, $value2, etc variables be used. 
      Code below:
      $FileRead1 = FileReadLine("C:\temp\sample.txt",1) For $count = 1 To _FileCountLines($FileRead1) Step 1 $string = FileReadLine($FileRead1, $count) $input = StringSplit($string, ",", 1) $value1 = $input[1] $value2 = $input[2] $value3 = $input[3] $value4 = $input[4] _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $value1, "A1") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $value2, "B1") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $value3, "C1") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $value4, "D1") Next  
×