# Search the Community

Showing results for tags 'Excel'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• General
• Announcements and Site News
• AutoIt v3
• AutoIt Help and Support
• AutoIt Technical Discussion
• AutoIt Example Scripts
• Scripting and Development
• Developer General Discussion
• Language Specific Discussion
• Operating System Deployment
• Windows Client
• Windows Server
• Office

### Categories

• AutoIt Team
• Beta
• MVP
• AutoIt
• Automation
• Databases and web connections
• Data compression
• Encryption and hash
• Games
• Hardware
• Information gathering
• Internet protocol suite
• Maths
• Media
• PDF
• Security
• Social Media and other Website API
• Windows
• Scripting and Development
• Operating System Deployment
• Windows Client
• Windows Server
• Office

• Forum
• AutoIt

### Calendars

• Community Calendar

### Filter by number of...

• 0 Replies

• 0 Reviews

• 0 Views

#### Minimum number of views

Found 193 results

1. ## Manipulating Excel

Hi guys. I know this is a newbie topic, very newbie, but i've read a lot of stuff and still don't get it. I just need to copy something from Excel cell, paste this in other program, copy something in this program and paste in other Excel cell. Something like... Copy A2 Use some WindowActivate and MouseMove stuff and CTRL+C (not a problem) Go back to the Excel sheet Paste that content in C2 Then Copy A3 Use some WindowActivate and MouseMove stuff and CTRL+C (not a problem) Go back to the Excel sheet Paste that content in C3 ... And it goes on The problem is, how can i "communicate" with Excel and do this row change? Like A2 to C2 and A3 to C3 ... In a efficient way that can be done like hundreds of times. Very newbie question but still not understanding this. Ty guys.
2. ## Identify the excel file that may need a password

Dear members of the forum, I need to open excel files that may or may not need a password and finally move the files that needs password to manual queue. Is there a fastest way to do this? PS: I have a huge respect for the rules of this forum. I am not asking assistance to override any security measure. I just need to segregate the files that needs passwords.

Hi guys, without including everything (unless you want it) I am copying data from a table in chrome and wanting to paste it into excel. Copying in Chrome works. I can paste it into the field i want by emulating goto -> ctrl V: WinActivate($dataload) WinWaitActive($dataload) Sleep(500) $oWorkbook1.Sheets("ItemReturn").Activate Sleep(500)$msg = "Measuring Sheet" conwrite() ttips2() Local Const $xlUp = -4162 With$oWorkbook1.ActiveSheet ; process active sheet $oRangeLast = .UsedRange.SpecialCells($xlCellTypeLastCell) ; get a Range that contains the last used cells $iRowCount = .Range(.Cells(1, 1), .Cells($oRangeLast.Row, "B")).Rows.Count ; get the the row count for the range starting in row/column 1 and ending at the last used row/column $iLastCell = .Cells($iRowCount + 1, "B").End($xlUp).Row ; start in the row following the last used row and move up to the first used cell in column "B" and grab this row number EndWith$NewStartCell = $iLastCell + 2$msg = "moving to location" conwrite() ttips2() Sleep(250) Send("^g") WinWait("Go To") Sleep(100) Send("B" & $NewStartCell) Sleep(100) Send("{ENTER}") Sleep(500) Send("^v") But, I want to use _excel_rangecopypaste, pasting from the clipboard _Excel_RangeCopyPaste($oWorkbook1.ActiveSheet, default, "B" & $NewStartCell,default,$xlPasteValuesAndNumberFormats) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeCopy Example 2", "Error pasting cells." & @CRLF & "@error = " & @error & ", @extended = " & @extended) however, this gives me error 4 , extended@: -2147352567 How can i fix this or find out how to debug this error? Thanks 4. ## [work around]$oActiveWorkbook.UserStatus not working

Hi. I try to figure out who is using a excel workbook which I can only open "read only". I use this code: #include <Array.au3> #include <Excel.au3> Local $sFile = ; excel file with path on a network drive Local$oExcel = _Excel_Open(True, True) Local $oTabelle = _Excel_BookOpen($oExcel, $sFile) Local$aUsers If IsObj($oTabelle) Then$aUsers = $oTabelle.UserStatus _ArrayDisplay($aUsers) EndIf If I am the one allowed to write to the excel file (I'm the first one who opened it) then I will get an array with myself: If my collegue opened the excel file first and I run the code I get the following error message: "H:\_Conrad lokal\Downloads\AutoIt3\_COX\Tests\test.au3" (9) : ==> The requested action with this object has failed.: $aUsers =$oTabelle.UserStatus $aUsers =$oTabelle^ ERROR The excel file is on a network drive. Is that's the problem? Regards, Conrad
5. ## Write inputs values into Colum and Raw in CSV

Dear all, Can someone show me how to en hance the below function to write in CSV into column and rows the input values ? I am getting this result: I would like the result to be as this From A1:C1 is for headers From A2:C2 is for input Data Global Const $GUI_EVENT_CLOSE = -3$sDataFilePath = @ScriptDir & "\Records.csv" #region ### START Koda GUI section ### Form= $Form1 = GUICreate("Demo1: New Record", 580, 115)$Input1 = GUICtrlCreateInput("", 10, 30, 270, 21) $Input2 = GUICtrlCreateInput("", 300, 30, 270, 21)$Input3 = GUICtrlCreateInput("", 10, 80, 270, 21) $Label1 = GUICtrlCreateLabel("Name:", 10, 10, 35, 17)$Label2 = GUICtrlCreateLabel("ID:", 300, 10, 18, 17) $Label3 = GUICtrlCreateLabel("Phone No:", 10, 60, 55, 17)$Button1 = GUICtrlCreateButton("Save to CSV", 450, 70, 120, 30) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch$nMsg Case $GUI_EVENT_CLOSE Exit Case$Button1 _ExportData() MsgBox(64, @ScriptName, "Record Saved.") EndSwitch WEnd Func _ExportData() If Not FileExists($sDataFilePath) Then FileWriteLine($sDataFilePath, "Name;ID;Phone No.;") EndIf For $i =$Input1 To $Input3 FileWrite($sDataFilePath, GUICtrlRead($i) & ";") Next FileWriteLine($sDataFilePath, "") EndFunc ;==>_ExportData May be Excel UDF has be to be added but I can manage that my self Thank you in advance

8. ## [Solved] Create borders around excel range

Sorry if this is a repost, but having some trouble searching for the answer and pretty tired right now. I'm just wondering how to make a border around a range of cells in Excel. I want the regular lines created by selecting "All Borders" option around F2:G3 I saw this code: With $oExcel.ActiveSheet.range("F2:G3") .Select .Borders($xlEdgeBottom).LineStyle = $xlContinuous .Borders($xlEdgeBottom).Weight = $xlThick .Borders($xlEdgeBottom).ColorIndex = $xlAutomatic EndWith but I get errors of these variables not existing. It seems these no longer exist in the "#include <Excel.au3>" Is there another include file I need? I got this to work for highlighting cells, wondering if there is a option similar to this for all borders?$oExcel.ActiveSheet.Range("F2:G3").Interior.ColorIndex = 6 Thanks
9. ## Accessing Data in an array from Excel

Hello, Is there a way wherein I can access the data from an array coming from an Excel file then have it assigned on to a variable? Below is a snippet of my current code. For now, it just reads and outputs the data from the excel file and have it displayed via an array. #include <Array.au3> #include <Excel.au3> #include <MsgBoxConstants.au3> Local $oExcel = _Excel_Open(False) If @error Then Exit MsgBox(0, "Error", "Error creating application object." & @CRLF & "Error: " & @error & " Extends: " & @extended) ; Open Excel Woorkbook and return object Local$sWorkbook = @ScriptDir & "\Excel Files\Test Data.xlsx" Local $oWorkbook = _Excel_BookOpen($oExcel, $sWorkbook, False, True) If @error Then MsgBox(0, "Error", "Error opening workbook'" &$sWorkbook & ".'" & @CRLF & "Error: " & @error & "Extends: " & @extended) _Excel_Close($oExcel) Exit EndIf Local$aResult = _Excel_RangeRead($oWorkbook) ; Error Trapping If @error Then MsgBox(0, "Error", "Error reading data from '" &$sWorkbook & ".'" & @CRLF & "Error: " & @error & " Extends: " & @extended) _Excel_Close($oExcel) Exit EndIf _ArrayDisplay($aResult) My Excel file has values from Column A to H with values from 1 to 30, what I desired to do is have the value in "A7" assigned on to a variable. Any help is appreciated. Thanks in advance.
10. ## close Excel file

I am trying to close an excel file that was not opened with _Excel_Open. How do I found the excel application object? I'm new and I am used to files and folders names, so an 'object' is new to me. I have the info too and simply spy, but I don't know which info is the object name/string. In the example from help doc's I see the code below and I tried justin pasting it into Scite. < Local $oExcel1 = ObjCreate("Excel.Application") ; Close the Excel instance which was not opened by _Excel_Open ; (will still be running because it was not opened by _Excel_Open) _Excel_Close($oExcel1) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_Close Example 1", "Error closing the Excel application." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Sleep(2000) Local$aProcesses = ProcessList("Excel.exe") MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_Close Example 1", "Function ended successfully." & @CRLF & @CRLF &$aProcesses[0][0] & " Excel instance(s) still running.") >
11. ## Excel: Set Background Color using some _EXCEL_* ?

Hello, I used the various "_Excel_*()" funktions to open workbooks, read and write cells. I was looking through the helpfile for the _EXCEL_* funktions, if there is a direkt way to set background color or text color -- if there is one, then I missed it? Searching the forum I found this posting demonstrating how to do this task using ... ObjCreate("Excel.Application") Is there a way to set the background color etc. with the native "_EXCEL_*" as well? Regards, Rudi.
12. ## for next with excel range addition

Hi guys, Wondering, is there a better way, likely to use 'for...next' to add a letter to each range, by moving right -> along a range of columns in excel. I currently use this, but its clunky. If $run = 1 Then$range = "B6:B41" If $run = 2 Then$range = "C6:C41" If $run = 3 Then$range = "D6:D41" If $run = 4 Then$range = "E6:E41" If $run = 5 Then$range = "F6:F41" If $run = 6 Then$range = "G6:G41" If $run = 7 Then$range = "H6:H41" If $run = 8 Then$range = "I6:I41" If $run = 9 Then$range = "J6:J41" If $run = 10 Then$range = "K6:K41" If $run = 11 Then$range = "L6:L41" If $run = 12 Then$range = "M6:M41" If $run = 13 Then$range = "N6:N41" If $run = 14 Then$range = "O6:O41" If $run = 15 Then$range = "P6:P41" If $run = 16 Then$range = "Q6:Q41" If $run = 17 Then$range = "R6:R41" If $run = 18 Then$range = "S6:S41" If $run = 19 Then$range = "T6:T41" If $run = 20 Then$range = "U6:U41" If $run = 21 Then$range = "V6:V41" If $run = 22 Then$range = "W6:W41" If $run = 23 Then$range = "X6:X41" If $run = 24 Then$range = "Y6:Y41" If $run = 25 Then$range = "Z6:Z41" If $run = 26 Then$range = "AA6:AA41" If $run = 27 Then$range = "AB6:AB41" If $run = 28 Then$range = "AC6:AC41" If $run = 29 Then$range = "AD6:AD41" If $run = 30 Then$range = "AE6:AE41" If $run = 31 Then$range = "AF6:AF41" If $run = 32 Then$range = "AG6:AG41" If $run = 33 Then$range = "AH6:AH41" If $run = 34 Then$range = "AI6:AI41" If $run = 35 Then$range = "AJ6:AJ41" If $run = 36 Then$range = "AK6:AK41" If $run = 37 Then$range = "AL6:AL41" If $run = 38 Then$range = "AM6:AM41" If $run = 39 Then$range = "AN6:AN41" If $run = 40 Then$range = "AO6:AO41" If $run = 41 Then$range = "AP6:AP41" If $run = 42 Then$range = "AQ6:AQ41" If $run = 43 Then$range = "AR6:AR41" If $run = 44 Then$range = "AS6:AS41" If $run = 45 Then$range = "AT6:AT41" If $run = 46 Then$range = "AU6:AU41" If $run = 47 Then$range = "AV6:AV41" If $run = 48 Then$range = "AW6:AW41" If $run = 49 Then$range = "AX6:AX41" If $run = 50 Then$range = "AY6:AY41" Normally, if it was going down the rows, i'd use this: For $i = 0 To UBound($iRowCount) - 1 $row =$i + 1 $range = "B"&$row&":B"&$row+1 Next so something like this, but i don't know how to code sequential columns: For$i = 0 To UBound($iColCount) - 1$col = $i + 1$range = $col&"1:"&$col&"40" Next If I don't make sense, let me know. Any help would be great. thanks

14. ## Opened Excel File Not activate

I try to activate my opened excel file using this code : #include <Excel.au3> $oExcel = _Excel_Open()$sCaption = $oExcel.Caption WinSetState($sCaption, "", @SW_MAXIMIZE) But when i edit cell in my excel file above code not working because it open new excel sheet.

25. ## Excel - Store an entire row into an array

Hi everybody, i have to store an entire row of a Excel workbook into an array. The row index is stored in a variable. How can i do it? Thanks in advance for your support.
×

• Wiki

• Back

• Git